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

neovim: fix the xsel path in the clipboard runtime provider #43995

Merged
merged 1 commit into from Jul 23, 2018

Conversation

kalbasit
Copy link
Member

@kalbasit kalbasit commented Jul 23, 2018

Motivation for this change

Currently the share/nvim/runtime/autoload/provider/clipboard.vim file has the following content:

  elseif exists('$DISPLAY') && executable('/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel') && s:cmd_ok('xsel -o -b')
    let s:copy['+'] = '/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel --nodetach -i -b'
    let s:paste['+'] = '/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel -o -b'
    let s:copy['*'] = '/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel --nodetach -i -p'
    let s:paste['*'] = '/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel -o -p'
    return '/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel'

as you can see, the s:cmd_ok('xsel -o -b') never evaluates to true and the X11 clipboard does not work. This PR changes the sed command to replace all occurrences of 'xsel so the command works. Here's the same snippet after the build:

  elseif exists('$DISPLAY') && executable('/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel') && s:cmd_ok('/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel -o -b')
    let s:copy['+'] = '/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel --nodetach -i -b'
    let s:paste['+'] = '/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel -o -b'
    let s:copy['*'] = '/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel --nodetach -i -p'
    let s:paste['*'] = '/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel -o -p'
    return '/nix/store/rl7q8rr97aasvx0bq3aimd50pf0nf4bk-xsel-unstable-2016-09-02/bin/xsel'
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

closes kalbasit/shabka#17

@Mic92
Copy link
Member

Mic92 commented Jul 23, 2018

Is a backport required here?

@kalbasit
Copy link
Member Author

@Mic92 probably since it’s a bug fix only.

@kalbasit kalbasit deleted the fix-neovim-unwrapped branch July 23, 2018 15:34
@Mic92
Copy link
Member

Mic92 commented Jul 23, 2018

git backport 5c7c2be
[detached HEAD 3cf0621] neovim: fix the xsel path in the clipboard runtime provider
Author: Wael M. Nasreddine wael.nasreddine@gmail.com
Date: Sun Jul 22 21:32:16 2018 -0700
1 file changed, 1 insertion(+), 1 deletion(-)

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.

NeoVim "+C and "+v are not copying to and pasting from X clipboard
3 participants