Skip to content

Add MMUseMouseTime, Revise #77 #168

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

Merged
merged 1 commit into from
Dec 10, 2015
Merged

Add MMUseMouseTime, Revise #77 #168

merged 1 commit into from
Dec 10, 2015

Conversation

splhack
Copy link
Contributor

@splhack splhack commented Dec 9, 2015

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

`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
@djjcast
Copy link

djjcast commented Dec 9, 2015

Thanks for the update! I think this looks like a good solution to the problem.

Although, we should be using mach_absolute_time() instead of NSDate to calculate the time interval between mouse clicks. I'm not sure if it's still the case, but calls to NSDate are not guaranteed to return times in chronological order:

http://stackoverflow.com/questions/7854932/will-two-nsdate-date-following-each-other-always-return-different-times

@splhack
Copy link
Contributor Author

splhack commented Dec 10, 2015

It is not the case. time resolution of mouse click or trackpad tap is 50~100ms-ish.

@djjcast
Copy link

djjcast commented Dec 10, 2015

Okay, I just installed the update and everything's working as expected; setting mousetime to zero disables multi clicks and setting mousetime to a really large value also works as expected. Thanks again.

Here's a vimscript snippet that sets MMUseMouseTime:

if has('gui_running') && has('macunix')
    call system('defaults write org.vim.MacVim MMUseMouseTime -bool TRUE')
endif

@splhack
Copy link
Contributor Author

splhack commented Dec 10, 2015

Thank you for the test. But I don't think the snippet is needed. It just one time execution on Terminal, it's persistent setting on the system.

splhack added a commit that referenced this pull request Dec 10, 2015
@splhack splhack merged commit e387a4c into master Dec 10, 2015
@splhack splhack deleted the feature/mousetime branch December 10, 2015 03:09
@djjcast
Copy link

djjcast commented Dec 10, 2015

Yeah, it's a one time thing that should go in a "new-system initialization script". The snippet's just a convenience hack so I don't have to think about setting MMUseMouseTime after cloning my Vim config to a new system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants