Skip to content
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

[WIP] Implement clipboard provider #479

Merged
merged 5 commits into from
Dec 8, 2018
Merged

[WIP] Implement clipboard provider #479

merged 5 commits into from
Dec 8, 2018

Conversation

equalsraf
Copy link
Owner

@equalsraf equalsraf commented Dec 3, 2018

A clipboard provider implemented by the GUI. This requires neovim from the master branch (v0.3.2)

It currently supports both clipboards and stores the selection type. Big question now is what happens with multiple GUIs attached, etc.

  • detect UI support at runtime
  • Test on windows with multi-line data on the clipboard (newline char)
  • There are some bugs on the provider, sometimes it returns invalid data, i.e. our function is returning an unexpected data structure
  • Add tests - in particular cover different types of selections

ref #298

Add a GuiClipboard() function that setups a custom clipboard provider
using an attached GUI. The plugin searches for attached GUIs with
attribute gui-clipboard and uses the last GUI. The clipboard provider
uses rpc calls/notifications to get/set the clipboard.
@equalsraf
Copy link
Owner Author

Looking good after fixing some bugs. Let the testing begin.

This commit does not alter default behaviour of the GUI, it only adds
the necessary RPC methods to get/set the clipboard.

- Vim (and Neovim) stores the selection type along with data in the
  clipboard. To achieve this the selection type (a string) is stored in
  the clipboard with the mimetype application/x-nvim-selection-type.
- In Windows/Mac both the * and + registers are the system clipboard

Also took the chance to

- remove the checkCommand in tst_shell.cpp, there was a race condition
  the tests that used it for the font commands
- Added some debugging and error reporting
@equalsraf equalsraf merged commit 79e3bae into master Dec 8, 2018
@equalsraf
Copy link
Owner Author

Merged into master. Keep in mind this is not enabled by default - you need to call call GuiClipboard() to enable it. After some testing we can have a look at improving the shim experience with some proper commands and docs.

@equalsraf equalsraf deleted the tb-clipboard3 branch July 6, 2019 18:47
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.

1 participant