Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork6.4k
feat(defaults): enable mouse support#19290
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
justinmk commentedJul 8, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Can't do this until the full suggestion in#15521 (comment) is implemented.
|
Uh oh!
There was an error while loading.Please reload this page.
matveyt commentedJul 8, 2022
As menu functionality has been implemented, do I understand right that we lack few default commands, such as |
justinmk commentedJul 9, 2022
correct |
matveyt commentedJul 10, 2022
@justinmk All done. The menu is embedded into C code to match with default mappings and autocommands. I also changed the default for AFAIU, the test emulates mouse clicks in the status line area, but the popup menu shows up unexpectedly. So what's the plan? To reset mousemodel to "extend", or to set it for this test specifically, or to patch popup menu implementation, so it doesn't show up upon a click outside of buffer area? |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
justinmk left a comment
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 is looking quite good, thanks for putting some thought into this :)
This comment was marked as resolved.
This comment was marked as resolved.
famiu commentedJul 14, 2022
It should, yeah |
matveyt commentedJul 14, 2022
@justinmk Okay, no problem. Should we also merge default autocmds in? Kind of
I see neither l10n nor menu API but that's not important, I guess. Just going to embed a piece of VimScript into Lua for now. |
justinmk commentedJul 14, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
no, don't want to decide that right now :) Menus reallyare just mappings. So
that's fine--thanks! |
matveyt commentedJul 15, 2022
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
| anoremenu PopUp.Paste "+gP | ||
| vnoremenu PopUp.Paste "+p | ||
| vnoremenu PopUp.Delete "_x | ||
| nnoremenu PopUp.Select\ All ggVG |
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.
todo(?): for many of these, it might be nice to maintain the cursor position and the viewport, so there is no visible jumping-around
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.
At least for "Select All" and other Visual-related stuff, it's impossible, AFAIU. The editor really wants to keep the cursor both visible and anchored to one of selection ends, so it may adjust the selected range upon any viewport change.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
justinmk commentedJul 15, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Future
|
matveyt commentedJul 16, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
anoremenu PopUp.Go\to\definition<Cmd>lua\if #vim.lsp.get_active_clients() >0 then\vim.lsp.buf.definition()\else\vim.cmd'normal! <C-]>'\end<CR>vnoremenu PopUp.Go\to\definition<Cmd>lua\if #vim.lsp.get_active_clients() >0 then\vim.lsp.buf.definition()\else\vim.cmd'normal! <C-]>'\end<CR> It's working but looks ugly, so I didn't add it yet. BTW. "vnoremenu" with the same code needed, because "amenu" would drop from Visual mode, and so it ignored the selected text in favor of the word under cursor.
---@paramexprLua function or string of"normals"---@paramoptsTable with optional keys:--- args - array of args for expr--- cond, fallback - some condition and "fallback" action--- keepview, remap - some boolean flags--- more stuff maybe...functionvim.action(expr,opts)...end Then the menu items could look like this But this one could also become redundant if menu API is ever ported to Lua.
<Lua>print"Hello world"<CR> which is a rough equivalent of <Cmd>lua<< <CR>print"Hello world"<CR> except the latter is not working, of course. But this probably deserves opening a new issue first. And again, it's more useful for mappings defined in VimScript. With |
justinmk commentedJul 17, 2022
do we need a |
justinmk commentedJul 17, 2022
windows CI failure is unrelated, known flakey test: |
This comment was marked as resolved.
This comment was marked as resolved.
gpanders commentedJul 17, 2022
|
justinmk commentedJul 17, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Resolution
Future
Locked to keep the summary visible. You can alwayschat or open an issue if you have new information/topics to discuss. |
Closes#15521