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
feat: able to change the ordering of popup menu #14006
base: master
Are you sure you want to change the base?
Conversation
thanks, that sounds interesting. However I think the option value should not be an opaque integer value Hopefully that is flexible enough and others don't want printf() formatting strings (or add arbitrary items to the pum menu). |
I see that some of the computation can be done at the option set callback, do I need to move the computation to the callback? |
I don't think so. The option callback is for completing option values. Does that work? |
can you please fix the failing CI? |
I might need to add some tests too. |
yes, please add tests |
runtime/doc/options.txt
Outdated
@@ -6273,6 +6273,23 @@ A jump table for the options with a short description can be found at |Q_op|. | |||
Insert mode completion. When zero as much space as available is used. | |||
|ins-completion-menu|. | |||
|
|||
*'pumordering'* *'po'* | |||
'pumordering' 'po' string (default "012") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be "word,kind,extra" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah
runtime/doc/options.txt
Outdated
The default value: | ||
0: word | ||
1: kind | ||
2: extra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, default value is no longer 0,1,2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea
src/popupmenu.c
Outdated
for (r = 0; r < 3; ++r) | ||
{ | ||
if (rounds[r] == 0 && prefix_pum_widths[rounds[r]] > 0) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove braces around single-line statements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing
can you add a few tests for:
|
I would say the current behavior for this case I could make it so that |
let buf = RunVimInTerminal('-S Xscript', {}) | ||
call TermWait(buf) | ||
call term_sendkeys(buf, "iaw\<C-X>\<C-u>") | ||
call TermWait(buf, 50) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TermWait()
is not needed before VerifyScreenDump()
runtime/doc/options.txt
Outdated
So the popup menu should look like the following | ||
"word" "kind" "extra" | ||
|
||
If this value is set to 102, the popup menu would look like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still reference to 102
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooops
What do you mean with it?
So that would basically mean, we would be able to re-order items, but cannot leave out items, right? |
If user do this |
Yes, it might be weird, and it sounds like a "don't complain if you use this setting and Vim does what you tell it. Don't do it then". Not sure if this should be allowed to have only 'extra' in 'pumordering'. Opinions? |
hi.
I was wondering if we can have a feature to change the ordering of the popup menu. The current popup menu is ordered as "word", "kind", "extra". I'm using an option to control this for now, not sure if there's a better way to accomplish this.
vim.mp4