Skip to content

MacVim deletes searcch string of other apps even with MMShareFindPboard set to false #773

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

Closed
chdiza opened this issue Nov 8, 2018 · 3 comments · Fixed by #780
Closed

Comments

@chdiza
Copy link
Contributor

chdiza commented Nov 8, 2018

I have MMShareFindPboard set to false so that MacVim's search string doesn't interfere with that of other Cocoa apps. (There's nothing worse than e.g., hitting Cmd-F in Safari only to find the little search box pre-populated with something like \(foo\|bar\)\+.)

I've noticed however that MacVim will clear another app's search string.

Reproduce: Open Safari, go to some webpage, and search (Cmd-F) for some string that is present on the page. Maybe hit Cmd-G to go to the next instance. Do not close the "find bar" in Safari. Then Cmd-Tab to an open MacVim document (or just open one afresh) and hit /; enter a search string and hit . Then Cmd-Tab back to Safari and observe that, while the find bar is still open and occurrences of your search string are still highlighted, your search string is gone, and Cmd-G no longer works because it doesn't know what string it should be looking for the next occurrence of.

@eirnym
Copy link
Contributor

eirnym commented Nov 8, 2018

additionally, with some plugins like better-whitespace, Safari's search string will be last search to clear whitespaces.

@ychin
Copy link
Member

ychin commented Nov 9, 2018

Can confirm this happens. Will look into it.

ychin added a commit to ychin/macvim that referenced this issue Nov 19, 2018
MMShareFindPboard is supposed to prevent MacVim from updating the system
find pasteboard when searching, but the previous behavior was that it
would only set the Vim-specific format to the find pasteboard so you
could still share search patterns across Vim windows but it has the
effect of clearing the global find pasteboard. Just fix that by making
MacVim not touch the system find pasteboard at all when
MMShareFindPboard is set to NO to respect user's wish. Cmd-G will still
use the system find pasteboard to make it easy to search in another
macOS program and jump to Vim. The user can always use `n` instead if
that's not desired.

Also update docs to make this clear, and rename all "OS X" to "macOS" to
keep up with the times.

Close macvim-dev#773
@ychin
Copy link
Member

ychin commented Nov 19, 2018

Just opened a pull request (#780) to fix this. Will merge that in shortly. I have decided to make Cmd-E and Cmd-G in MacVim still respect the system pasteboard even with MMShareFindPboard set to NO because it's an explicit MacVim command and it's a little more consistent with how other macOS apps behave. You can use normal Vim commands like n and / and they won't pollute the system find pasteboard.

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 a pull request may close this issue.

3 participants