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 --- .../clipboard/clipboard_provider_spec.lua | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'test') diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index 0550d22fa6..98b8d2dd45 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -285,6 +285,22 @@ describe('clipboard usage', function() the text]]) end) + it('is updated on global changes', function() + insert([[ + text + match + match + text + ]]) + execute('g/match/d') + eq('match\n', eval('getreg("*")')) + feed('u') + eval('setreg("*", "---")') + execute('g/test/') + feed('') + eq('---', eval('getreg("*")')) + end) + end) describe('with clipboard=unnamedplus', function() @@ -329,6 +345,21 @@ describe('clipboard usage', function() really unnamed the plus]]) end) + it('is updated on global changes', function() + insert([[ + text + match + match + text + ]]) + execute('g/match/d') + eq('match\n', eval('getreg("+")')) + feed('u') + eval('setreg("+", "---")') + execute('g/test/') + feed('') + eq('---', eval('getreg("+")')) + end) end) it('supports :put', function() -- cgit