Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-complete popup is not big enough #16542

Closed
Zylann opened this issue Feb 10, 2018 · 15 comments
Closed

Auto-complete popup is not big enough #16542

Zylann opened this issue Feb 10, 2018 · 15 comments

Comments

@Zylann
Copy link
Contributor

Zylann commented Feb 10, 2018

Godot 3.0

When getting nodes from a form, I ended up with paths too long for the auto-completion box:

image

Maybe it should expand if paths are too big?

@bfloch
Copy link
Contributor

bfloch commented Feb 12, 2018

Or it could be smarter with paths like this vim plugin:
vim_autocomplete

@hubbyist
Copy link

I had a similar issue #4704 it can be closed if this one is fixed.

@godotengine godotengine deleted a comment Feb 12, 2018
@profan
Copy link
Contributor

profan commented Jun 12, 2018

So, with a crude change in

theme->set_constant("completion_max_width", "TextEdit", 50);

We can instead get something like this (max width set to 128, not exposed in any settings though):
image

and when the window is squashed, it shows like this
image

This small change might be of interest regardless because it doesn't seem to break in face of less-wide windows, but maybe it would be nice to have a smaller max width (60-80?) and maybe just show the beginning + end as suggested, or only the end bits as much as possible?

@profan
Copy link
Contributor

profan commented Jun 12, 2018

Another case where I edited this bit:

int w2 = MIN(cache.font->get_string_size(completion_options[i]).x, cmax_width);

To basically just straight up use the actual size it calculates instead of clamp it to a max size with MIN as it does atm, shown here with an absurdly deep hierarchy:
image

With the way this looks, it would probably much more sane to properly adjust the size of the strings to some form like Node2D/.../FinalNode but only for nodes where it exceeds some reasonable max size?

All thoughts welcome!

.. went back and read through #4704, so Node2D/.../Node2D is the preferred solution to implement at the moment?

Accomplishing something like this:
image

doesn't seem too difficult, but should it break "anywhere" or should it respect "full nodes" and not just cut the string in half, regardless of if it overlaps a node name or not, ie the difference between:
Node/No...Some/ and Node/.../Some/

Paging @akien-mga for feedback before i PR anything :) (ignore this akien, i'll work it out!)

@AlexHolly
Copy link
Contributor

AlexHolly commented Aug 13, 2018

I think adding a h_scroll_bar to the window is the best solution.
I made a version with an ItemList and added h_scoll to it.
Before I spend more time on it I would like to know what you think.

peek 2018-08-13 22-26

@girng
Copy link

girng commented Dec 4, 2018

ty @Zylann for making this!! was just about to create an issue
running into this as well
image

maybe a toggleable setting in the editor to fill the auto-complete popup to 100% size (dependent on the text inside)? not sure

@hubbyist
Copy link

hubbyist commented Jun 19, 2019

@AlexHolly Is h_scroll_bar responding to left and right arrows as well? Then it seems to be fixing #4704 as well IMO.

@AlexHolly
Copy link
Contributor

@hubbyist I dont see any relation to #4707 maybe there is a typo? Currently h_scroll_bar will not move to left/right with arrow keys in #21181

@hubbyist
Copy link

Issue is #4704 fixed previous post.

@hubbyist
Copy link

But if mouse is necessary for this to work also shortening with ... as place holder is necessary so than both end of a node path can be identified while browsing autocomplete list.

@profan
Copy link
Contributor

profan commented Jun 19, 2019

So I kind of just left this and forgot about it, but I did have a version working that showed both ends of the node path and had "..." in the middle, as that seemed the most useful path to go, maybe an option added to ProjectSettings to set the max length of the autocomplete popup could be nice as well so we can have a reasonable default length but then people can configure it if they want something specific. (this is as well as the ... thing, but maybe I can make the second part another PR)

@Calinou
Copy link
Member

Calinou commented Nov 23, 2019

@profan Bump. Could you make a pull request with your changes? If you don't have time to do this, could you commit something to your fork and link it here so someone else can continue working on it? Thanks in advance 🙂

@profan
Copy link
Contributor

profan commented Dec 10, 2019

@Calinou Absolutely, sorry I left this for a while in the midst of other things, I'll take a look at it again in a few days 👍 (and PR what I'd done)

@TheSofox
Copy link
Contributor

Seems like this has been fixed:

image
image

@Calinou
Copy link
Member

Calinou commented Dec 11, 2023

It doesn't get as wide in 3.5.2:

image

That said, since this was implemented in 4.0, I'll close this. (This would be a lot of work to backport, given there's been a CodeEdit refactoring since.)

@Calinou Calinou closed this as completed Dec 11, 2023
@Calinou Calinou added this to the 4.0 milestone Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants