-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add MenuPopupChanged (orig. Qiming Zhao) #4176
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
Conversation
The name is very confusing, since MenuPopup is for the right-click popup menu, while this event is for the completion menu, aka PUM. We do have the CompleteDone event, which comes much closer. Can we call it CompleteChanged ? |
There is definitely confusion in the documentation between the two popup menus (PUM vs right click) but I am not certain this autocmd adds to it. FYI the specific justification for the name MenuPopupChanged was given by @justinmk as follows:
This autocmd also reacts to resize events, even when the selected item doesn't change, and provides the position/dimensions of the completion PUM. What do you think? |
What is the "right-click popup menu" if not a PUM? (actual question, not rhetorical) |
See |
I mean semantically, not technically. |
There is definitely confusion in the documentation between the two
popup menus (PUM vs right click) but I am not certain this autocmd
adds to it.
It does, because it uses the prefix MenuPopup instead of Complete, and
the event is associated with Complete and totally unrelated to
MenuPopup.
Both are popup menus, just like popup menus exist in applications
everywhere. To distinguish them, one is called the right-click popup
menu, the other the completion popup (or Insert mode completion popup
menu, to be more specific).
FYI the specific justification for the name MenuPopupChanged was given
by @justinmk as follows:
>> MenuPopupChanged also sounds very similar to MenuPopup which is
>> autocmd for right click. Do we want to change the autocmd to
>> CompleteChanged or CompleteItemChanged instead?
>
> CompleteFoo as already discussed is not appropriate because this event is not completion-related, it is popup-related. The name MenuPopupChanged is intentional and was explained in #9616 (comment) :
>
> Vim has an old event called MenuPopup (grep EVENT_MENUPOPUP in the Vim source) which used to be GUI-only but is now also used for :Termdebug stuff.
>
> So let's name this new event MenuPopupChanged. Like Vim, we'll eventually have the ability for plugins to show an arbitrary popupmenu, so it's not just for "completion".
This autocmd also reacts to resize events, even when the selected item
doesn't change, and provides the position/dimensions of the completion
PUM.
What do you think?
This reasoning is bogus. Autocommand events are not there for generic
notifications, they must be as specific as possible. In this case what
the plugin writers want is an event when the completion popup menu
changed. It's definitely not for the right-click popup menu.
The "PUM" as it's called internally, can be used for other things, but I
doubt we want to use the same event for contents not related to
Completion.
…--
hundred-and-one symptoms of being an internet addict:
130. You can't get out of your desk even if it's time to eat or time
to go to the bathroom.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
It matters very little to me what the name is, because all choices so far are suboptimal. MenuPopupChanged was an attempt to read the tea-leaves of Vim design decisions.
It is conceivable that plugin authors will also want MenuPopupChanged information for the "right-click menu", not only the "completion menu". Does that mean there will be MenuPopupChanged and CompletionChanged events? |
It's called PUM externally as well, including for |
It matters very little to me what the name is, because all choices so
far are suboptimal. MenuPopupChanged was an attempt to read the
tea-leaves of Vim design decisions.
I prefer coffee :-)
> This reasoning is bogus. Autocommand events are not there for generic
> notifications, they must be as specific as possible.
It is conceivable that plugin authors will also want MenuPopupChanged
information for the "right-click menu", not only the "completion
menu". Does that mean there will be MenuPopupChanged and
CompletionChanged events?
I don't see how the right-click popup menu can change after it's
displayed. Or why someone would be interested in that change if it were
possible.
For Completion there are lots of plugins trying to do something
complicated, thus adding an event specifically for completion would make
sense.
Most interesting is probably when the selected entry changes, then a
preview of the suggestion could be displayed. Would be more useful once
the popup window support has been implemented.
…--
Birthdays are healthy. The more you have them, the longer you live.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
df59ca7
to
3adf55d
Compare
Updated for recent insexpand.c refactor. Replaced MenuPopupChanged with CompleteChanged (Note: I imply no opinion on the naming and do not intend to cause tension between vim and neovim). |
@brammool once again, d7f246c does not include attribution to the original author nor the Neovim project. That's not how copyright works.
Attribution has nothing to do with copyright. Since a pull request is
created, the author has explicitly confirmed agreeing with the copyright
conditions of the project.
Every change can be changed by others, it's close to impossible to
mention all people involved. I also don't mention what I changed on top
of the pull request. I do try to mention at least the person who sent
the change. Github user names don't make this easier.
…--
Get a life? What is the URL where it can be downloaded?
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
I think you mean the licensing conditions of the project. Since Vim doesn't use a copyright assignment agreement, the author retains copyright. The assumption is that, unless stated otherwise, they're contributing the code under Vim's license.
For what it's worth, Andy made sure to include the original author's name in both the subject of this PR and the commit message. |
This is a translation of neovim/neovim#9616, which adds an autocmd for when the popup menu item changes during insert completion (and also when the pum is redrawn due to resizing). This is useful e.g., for showing information about the selected item in the cmdline or making text edits during selection. The original author is Qiming Zhao aka. @chemzqm.