-
-
Notifications
You must be signed in to change notification settings - Fork 682
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
Use 'mousetime' to recognize multi clicks #77
Conversation
From what I can tell, this makes MacVim ignore the OS settings for double-click threshold, which may be undesirable for some users. If so, I'd expect this kind of behavioral change to be toggled via an option, rather than replace the existing behavior wholesale. |
Yes, it ignores the OS settings and relies on mousetime instead. I agree that this change might catch some users off-guard. Here are a couple of ways to handle it:
The reason I want MacVim to support mousetime is to be able to dynamically disable multi clicks through vimscript. Here's my use case: map <silent> <LeftMouse>
\ <LeftMouse>:<C-u>if &filetype ==# 'vimfiler' \|
\ set mousetime=0 \|
\ let cursorchar = matchstr(getline('.'), '\%' . col('.') . 'c.') \|
\ if (cursorchar ==# g:vimfiler_tree_opened_icon) \|\|
\ (cursorchar ==# g:vimfiler_tree_closed_icon) \|
\ execute "normal 0\<Plug>(vimfiler_expand_tree)" \|
\ else \|
\ execute "normal 0\<Plug>(vimfiler_cd_or_edit)" \|
\ endif \|
\ unlet cursorchar \|
\ else \|
\ set mousetime=500 \|
\ endif<CR> This disables multi clicks in all vimfiler windows by setting mousetime to 0. |
I definitely think this needs preference toggle (and should default to off to preserve existing behavior). There's examples of adding these sorts of preferences in the recent ligature pull request you could base the work off of. |
I was thumbs-down on this, but now I think I may have turned 180 degrees. Is it the case that: If that is the case, then this PR should be merged[1] and there should be a new entry under And, there should be either no preference option to toggle this, or at worst, if we're going to include yet another divergence from Vim behavior, I would strongly favor @djjcast's idea "2". Since Vim in the console (including the Vim buried in MacVim when run in console mode) already obeys [1] Subject, of course, to this being the right way to make MacVim obey |
I think There isn't a consensus between the core GUI implementations on how to interpret double-clicks - some use The GTK+ version uses Also, this README outlines how the GUI implementations should work as a "clever terminal". |
Hm, the But at the same time, there's a lot of (I would argue correct) divergence between vim, gvim and MacVim when it comes to GUI-related options; much of that divergence is based on things that the Windows and Mac GUIs don't do or which aren't idiomatic or sensible in the context of being a reasonably well-behaved and convention-conforming application. And for the GUI variants like gVim and MacVim I'd argue that being "well behaved" in the appropriate OS context is an important feature. I don't see what's so special about vim that it gets to dictate an override to my double-click speed; I've always been annoyed by gVim's adherence to I feel less strongly that such fallback should be the default (although MacVim already jumps through a lot of engineering hoops to try to preserve previously-existing behavior, so I'd say there is convention in place for doing so). I feel even less strongly about how the fallback should be enabled. It's true MacVim has a growing number of preference toggles that exist outside the realm of the Another option would be to look at how the |
👍🏻 |
`MMUseMouseTime` allows to override the time threshold for detecting multiple mouse down events using Vim `mousetime` option. $ defaults write org.vim.MacVim MMUseMouseTime -bool TRUE
Add MMUseMouseTime, Revise #77
Use the value of the Vim mousetime setting to recognize multi clicks. MacVim currently uses the mouse event property clickCount to recognize mulit clicks.