From acdac914d554fae421c4e71c9d1dffc5cea4505b Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Mon, 8 Jun 2015 16:47:10 -0300 Subject: clipboard: avoid clipboard during :global. #2809 This is equivalent to patches 7.4.396, 7.4.445 and 7.4.598. vim-patch:7.4.396 Problem: When 'clipboard' is "unnamed", :g/pat/d is very slow. (Praful) Solution: Only set the clipboard after the last delete. (Christian Brabandt) https://github.com/vim/vim/commit/1f285eb49a709e00552f7bef7e74efff5ae79026 vim-patch:7.4.445 Problem: Clipboard may be cleared on startup. Solution: Set clip_did_set_selection to -1 during startup. (Christian Brabandt) https://github.com/vim/vim/commit/1a19d37d90f037c09183ba68fdddf70ab8ee179a vim-patch:7.4.598 Problem: ":tabdo windo echo 'hi'" causes "* register not to be changed. (Salman Halim) Solution: Change how clip_did_set_selection is used and add clipboard_needs_update and global_change_count. (Christian Brabandt) https://github.com/vim/vim/commit/af6a579263a688f30bfbbee72b28d08cc7e0f3d4 Co-Author: @bfredl --- src/nvim/testdir/test_eval.in | 17 ++++++++++++++--- src/nvim/testdir/test_eval.ok | Bin 10578 -> 11106 bytes 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_eval.in b/src/nvim/testdir/test_eval.in index 95a59ee42a..328ee2e127 100644 --- a/src/nvim/testdir/test_eval.in +++ b/src/nvim/testdir/test_eval.in @@ -1,7 +1,6 @@ Test for various eval features. vim: set ft=vim : -Note: system clipboard support is not tested. I do not think anybody will thank -me for messing with clipboard. +Note: system clipboard is saved, changed and restored. STARTTEST :so small.vim @@ -122,7 +121,19 @@ call SetReg('/', ['abc/']) call SetReg('/', ["abc/\n"]) call SetReg('=', ['"abc/"']) call SetReg('=', ["\"abc/\n\""]) - +$put ='{{{1 System clipboard' +" Save and restore system clipboard. +" If no connection to X-Server is possible, test should succeed. +:let _clipreg = ['+', getreg('+'), getregtype('+')] +:let _clipopt = &cb +:let &cb='unnamedplus' +:1y +:AR + +:tabdo :windo :echo "hi" +:3y +:AR + +:let &cb=_clipopt +:call call('setreg', _clipreg) $put ='{{{1 Errors' call ErrExe('call setreg()') call ErrExe('call setreg(1)') diff --git a/src/nvim/testdir/test_eval.ok b/src/nvim/testdir/test_eval.ok index 061e0cfd2f..2cdb8f5da8 100644 Binary files a/src/nvim/testdir/test_eval.ok and b/src/nvim/testdir/test_eval.ok differ -- cgit