Skip to content

Conversation

equalsraf
Copy link
Owner

@equalsraf equalsraf commented Jul 26, 2018

A clipboard provider implemented by the GUI

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

This is based on the approach from neovim-gtk. As it stands the call signatures are not compatible, but I think they could be. we use all the arguments in the set event and the api in neovim-gtk only passes arg0 and 2. The event names are different so there should be no conflict.

TODO

  • get the correct channel id instead of 1
  • Test on windows with multi-line data on the clipboard (newline char)
  • Add guards to the provider, merge with the shim, etc
  • Remove from the shim for now
  • 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

@equalsraf equalsraf changed the title Implement clipboard provider [WIP] Implement clipboard provider Jul 26, 2018
@equalsraf equalsraf force-pushed the tb-clipboard branch 4 times, most recently from 9014461 to 2adf4d4 Compare August 1, 2018 17:15
@equalsraf equalsraf force-pushed the tb-clipboard branch 4 times, most recently from 0b7a961 to b76ffbe Compare August 9, 2018 18:41
@equalsraf equalsraf force-pushed the tb-clipboard branch 9 times, most recently from a255b8a to 7bcfa24 Compare August 17, 2018 10:07
@equalsraf equalsraf mentioned this pull request Aug 21, 2018
Rui Abreu Ferreira added 3 commits September 5, 2018 18:44
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

A clipboard provider is included in the test directory that forwards
clipboard operations to the gui. But we will have to push upstream to
support regular functions for the clipboard provider.

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
Copy link
Owner Author

Replaced by #479

@equalsraf equalsraf closed this Dec 3, 2018
@equalsraf equalsraf deleted the tb-clipboard branch June 20, 2020 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant