From 65fb622000af8e3dbb65480e1581758ecf4ba3e2 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 9 Apr 2017 00:12:26 +0300 Subject: functests: Replace execute with either command or feed_command Hope this will make people using feed_command less likely: this hides bugs. Already found at least two: 1. msgpackparse() will show internal error: hash_add() in case of duplicate keys, though it will still work correctly. Currently silenced. 2. ttimeoutlen was spelled incorrectly, resulting in option not being set when expected. Test was still functioning somehow though. Currently fixed. --- .../clipboard/clipboard_provider_spec.lua | 86 +++++++++++----------- 1 file changed, 43 insertions(+), 43 deletions(-) (limited to 'test/functional/clipboard/clipboard_provider_spec.lua') diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index d969d4a487..eb2eeee0da 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -3,7 +3,7 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert -local execute, expect, eq, eval = helpers.execute, helpers.expect, helpers.eq, helpers.eval +local feed_command, expect, eq, eval = helpers.feed_command, helpers.expect, helpers.eq, helpers.eval local function basic_register_test(noblock) insert("some words") @@ -95,7 +95,7 @@ describe('clipboard usage', function() before_each(function() reset() - execute('call getreg("*")') -- force load of provider + feed_command('call getreg("*")') -- force load of provider end) it('has independent "* and unnamed registers per default', function() @@ -140,8 +140,8 @@ describe('clipboard usage', function() end) it('support autodectection of regtype', function() - execute("let g:test_clip['*'] = ['linewise stuff','']") - execute("let g:test_clip['+'] = ['charwise','stuff']") + feed_command("let g:test_clip['*'] = ['linewise stuff','']") + feed_command("let g:test_clip['+'] = ['charwise','stuff']") eq("V", eval("getregtype('*')")) eq("v", eval("getregtype('+')")) insert("just some text") @@ -156,7 +156,7 @@ describe('clipboard usage', function() insert([[ much text]]) - execute("let g:test_clip['*'] = [['very','block'],'b']") + feed_command("let g:test_clip['*'] = [['very','block'],'b']") feed('gg"*P') expect([[ very much @@ -170,15 +170,15 @@ describe('clipboard usage', function() end) it('supports setreg', function() - execute('call setreg("*", "setted\\ntext", "c")') - execute('call setreg("+", "explicitly\\nlines", "l")') + feed_command('call setreg("*", "setted\\ntext", "c")') + feed_command('call setreg("+", "explicitly\\nlines", "l")') feed('"+P"*p') expect([[ esetted textxplicitly lines ]]) - execute('call setreg("+", "blocky\\nindeed", "b")') + feed_command('call setreg("+", "blocky\\nindeed", "b")') feed('"+p') expect([[ esblockyetted @@ -188,13 +188,13 @@ describe('clipboard usage', function() end) it('supports let @+ (issue #1427)', function() - execute("let @+ = 'some'") - execute("let @* = ' other stuff'") + feed_command("let @+ = 'some'") + feed_command("let @* = ' other stuff'") eq({{'some'}, 'v'}, eval("g:test_clip['+']")) eq({{' other stuff'}, 'v'}, eval("g:test_clip['*']")) feed('"+p"*p') expect('some other stuff') - execute("let @+ .= ' more'") + feed_command("let @+ .= ' more'") feed('dd"+p') expect('some more') end) @@ -202,7 +202,7 @@ describe('clipboard usage', function() it('pastes unnamed register if the provider fails', function() insert('the text') feed('yy') - execute("let g:cliperror = 1") + feed_command("let g:cliperror = 1") feed('"*p') expect([[ the text @@ -214,7 +214,7 @@ describe('clipboard usage', function() -- the basic behavior of unnamed register should be the same -- even when handled by clipboard provider before_each(function() - execute('set clipboard=unnamed') + feed_command('set clipboard=unnamed') end) it('works', function() @@ -222,7 +222,7 @@ describe('clipboard usage', function() end) it('works with pure text clipboard', function() - execute("let g:cliplossy = 1") + feed_command("let g:cliplossy = 1") -- expect failure for block mode basic_register_test(true) end) @@ -237,7 +237,7 @@ describe('clipboard usage', function() -- "+ shouldn't have changed eq({''}, eval("g:test_clip['+']")) - execute("let g:test_clip['*'] = ['linewise stuff','']") + feed_command("let g:test_clip['*'] = ['linewise stuff','']") feed('p') expect([[ words @@ -247,7 +247,7 @@ describe('clipboard usage', function() it('does not clobber "0 when pasting', function() insert('a line') feed('yy') - execute("let g:test_clip['*'] = ['b line','']") + feed_command("let g:test_clip['*'] = ['b line','']") feed('"0pp"0p') expect([[ a line @@ -258,20 +258,20 @@ describe('clipboard usage', function() it('supports v:register and getreg() without parameters', function() eq('*', eval('v:register')) - execute("let g:test_clip['*'] = [['some block',''], 'b']") + feed_command("let g:test_clip['*'] = [['some block',''], 'b']") eq('some block', eval('getreg()')) eq('\02210', eval('getregtype()')) end) it('yanks visual selection when pasting', function() insert("indeed visual") - execute("let g:test_clip['*'] = [['clipboard'], 'c']") + feed_command("let g:test_clip['*'] = [['clipboard'], 'c']") feed("viwp") eq({{'visual'}, 'v'}, eval("g:test_clip['*']")) expect("indeed clipboard") -- explicit "* should do the same - execute("let g:test_clip['*'] = [['star'], 'c']") + feed_command("let g:test_clip['*'] = [['star'], 'c']") feed('viw"*p') eq({{'clipboard'}, 'v'}, eval("g:test_clip['*']")) expect("indeed star") @@ -280,7 +280,7 @@ describe('clipboard usage', function() it('unamed operations work even if the provider fails', function() insert('the text') feed('yy') - execute("let g:cliperror = 1") + feed_command("let g:cliperror = 1") feed('p') expect([[ the text @@ -294,11 +294,11 @@ describe('clipboard usage', function() match text ]]) - execute('g/match/d') + feed_command('g/match/d') eq('match\n', eval('getreg("*")')) feed('u') eval('setreg("*", "---")') - execute('g/test/') + feed_command('g/test/') feed('') eq('---', eval('getreg("*")')) end) @@ -307,7 +307,7 @@ describe('clipboard usage', function() describe('with clipboard=unnamedplus', function() before_each(function() - execute('set clipboard=unnamedplus') + feed_command('set clipboard=unnamedplus') end) it('links the "+ and unnamed registers', function() @@ -320,13 +320,13 @@ describe('clipboard usage', function() -- "* shouldn't have changed eq({''}, eval("g:test_clip['*']")) - execute("let g:test_clip['+'] = ['three']") + feed_command("let g:test_clip['+'] = ['three']") feed('p') expect('twothree') end) it('and unnamed, yanks to both', function() - execute('set clipboard=unnamedplus,unnamed') + feed_command('set clipboard=unnamedplus,unnamed') insert([[ really unnamed text]]) @@ -340,8 +340,8 @@ describe('clipboard usage', function() -- unnamedplus takes predecence when pasting eq('+', eval('v:register')) - execute("let g:test_clip['+'] = ['the plus','']") - execute("let g:test_clip['*'] = ['the star','']") + feed_command("let g:test_clip['+'] = ['the plus','']") + feed_command("let g:test_clip['*'] = ['the star','']") feed("p") expect([[ text @@ -356,11 +356,11 @@ describe('clipboard usage', function() match text ]]) - execute('g/match/d') + feed_command('g/match/d') eq('match\n', eval('getreg("+")')) feed('u') eval('setreg("+", "---")') - execute('g/test/') + feed_command('g/test/') feed('') eq('---', eval('getreg("+")')) end) @@ -375,13 +375,13 @@ describe('clipboard usage', function() it('supports :put', function() insert("a line") - execute("let g:test_clip['*'] = ['some text']") - execute("let g:test_clip['+'] = ['more', 'text', '']") - execute(":put *") + feed_command("let g:test_clip['*'] = ['some text']") + feed_command("let g:test_clip['+'] = ['more', 'text', '']") + feed_command(":put *") expect([[ a line some text]]) - execute(":put +") + feed_command(":put +") expect([[ a line some text @@ -392,9 +392,9 @@ describe('clipboard usage', function() it('supports "+ and "* in registers', function() local screen = Screen.new(60, 10) screen:attach() - execute("let g:test_clip['*'] = ['some', 'star data','']") - execute("let g:test_clip['+'] = ['such', 'plus', 'stuff']") - execute("registers") + feed_command("let g:test_clip['*'] = ['some', 'star data','']") + feed_command("let g:test_clip['+'] = ['such', 'plus', 'stuff']") + feed_command("registers") screen:expect([[ ~ | ~ | @@ -418,17 +418,17 @@ describe('clipboard usage', function() insert('s/s/t/') feed('gg"*y$:*') expect('t/s/t/') - execute("let g:test_clip['*'] = ['s/s/u']") + feed_command("let g:test_clip['*'] = ['s/s/u']") feed(':*') expect('t/u/t/') end) it('supports :redir @*>', function() - execute("let g:test_clip['*'] = ['stuff']") - execute('redir @*>') + feed_command("let g:test_clip['*'] = ['stuff']") + feed_command('redir @*>') -- it is made empty eq({{''}, 'v'}, eval("g:test_clip['*']")) - execute('let g:test = doesnotexist') + feed_command('let g:test = doesnotexist') feed('') eq({{ '', @@ -436,7 +436,7 @@ describe('clipboard usage', function() 'E121: Undefined variable: doesnotexist', 'E15: Invalid expression: doesnotexist', }, 'v'}, eval("g:test_clip['*']")) - execute(':echo "Howdy!"') + feed_command(':echo "Howdy!"') eq({{ '', '', @@ -448,7 +448,7 @@ describe('clipboard usage', function() end) it('handles middleclick correctly', function() - execute('set mouse=a') + feed_command('set mouse=a') local screen = Screen.new(30, 5) screen:attach() @@ -471,7 +471,7 @@ describe('clipboard usage', function() the a target]]) -- on error, fall back to unnamed register - execute("let g:cliperror = 1") + feed_command("let g:cliperror = 1") feed('<6,1>') expect([[ the source -- cgit From 9882e25dc44f1165e1edc8b3898356e493b6b3fe Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 20 Aug 2017 02:13:04 +0200 Subject: clipboard: avoid error flood during :redir redir_write(): - This is a "batch" operation which was not yet covered by start_batch_changes() adjust_clipboard_name(): - msg() and friends during :redir will, of course, cause redir_write() to try to capture that message, which causes recursion. - EMSG() here is trouble: if it interrupts :redir it is a mess. Rather than deal with the mess, show a non-error message. closes #7182 closes #7184 closes #7183 ref #6048 ref #7032 --- .../clipboard/clipboard_provider_spec.lua | 32 ++++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'test/functional/clipboard/clipboard_provider_spec.lua') diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index eb2eeee0da..941112d9ae 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -4,6 +4,7 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local feed_command, expect, eq, eval = helpers.feed_command, helpers.expect, helpers.eq, helpers.eval +local command = helpers.command local function basic_register_test(noblock) insert("some words") @@ -80,15 +81,34 @@ local function basic_register_test(noblock) expect("two and three and one") end -describe('the unnamed register', function() +describe('clipboard', function() before_each(clear) - it('works without provider', function() + + it('unnamed register works without provider', function() eq('"', eval('v:register')) basic_register_test() end) + + it('`:redir @+>` with invalid g:clipboard shows error exactly once', function() + local screen = Screen.new(72, 8) + screen:attach() + command("let g:clipboard = 'bogus'") + feed_command('redir @+> | :call system("cat CONTRIBUTING.md") | redir END') + -- it is made empty + screen:expect([[ + ~ | + ~ | + ~ | + Error detected while processing function provider#clipboard#Executable: | + line 5: | + clipboard: invalid g:clipboard | + clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | + Press ENTER or type command to continue^ | + ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) + end) end) -describe('clipboard usage', function() +describe('clipboard', function() local function reset(...) clear('--cmd', 'let &rtp = "test/functional/fixtures,".&rtp', ...) end @@ -139,7 +159,7 @@ describe('clipboard usage', function() eq({'some\ntext', '\nvery binary\n'}, eval("getreg('*', 1, 1)")) end) - it('support autodectection of regtype', function() + it('autodetects regtype', function() feed_command("let g:test_clip['*'] = ['linewise stuff','']") feed_command("let g:test_clip['+'] = ['charwise','stuff']") eq("V", eval("getregtype('*')")) @@ -169,7 +189,7 @@ describe('clipboard usage', function() eq({{' much', 'ktext', ''}, 'b'}, eval("g:test_clip['+']")) end) - it('supports setreg', function() + it('supports setreg()', function() feed_command('call setreg("*", "setted\\ntext", "c")') feed_command('call setreg("+", "explicitly\\nlines", "l")') feed('"+P"*p') @@ -187,7 +207,7 @@ describe('clipboard usage', function() ]]) end) - it('supports let @+ (issue #1427)', function() + it('supports :let @+ (issue #1427)', function() feed_command("let @+ = 'some'") feed_command("let @* = ' other stuff'") eq({{'some'}, 'v'}, eval("g:test_clip['+']")) -- cgit From cc7e344f8357d07b1df17df0b322152d5c50739b Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 20 Aug 2017 18:53:58 +0200 Subject: clipboard: remove start_batch_changes() in redir_write() start_batch_changes() doesn't avoid invoking the clipboard once-per-line, because the loop is actually in ex_echo(), which calls redir_write() for each message. But we've already entered start_batch_changes() by then, so that was never the problem. redir_write at /home/vagrant/old.neovim/build/../src/nvim/message.c:2523 msg_puts_attr_len at /home/vagrant/old.neovim/build/../src/nvim/message.c:1600 msg_outtrans_len_attr at /home/vagrant/old.neovim/build/../src/nvim/message.c:1221 ex_echo at /home/vagrant/old.neovim/build/../src/nvim/eval.c:19433 do_one_cmd at /home/vagrant/old.neovim/build/../src/nvim/ex_docmd.c:2242 Trying to defer _explicit_ clipboard updates is difficult. :redir @+ | silent echo system('cat foo') | redir END is essentially equivalent to: for l in readfile('foo') let @+ .= l endfor We cannot make judgements about when to ignore a script's bad decisions. start_batch_changes() only works around the case of clipboard=unnamed, i.e. _implicit_ clipboard updates (`:g/foo/d`). Not explicit assignment. --- .../clipboard/clipboard_provider_spec.lua | 32 ++++++++++++++++------ 1 file changed, 24 insertions(+), 8 deletions(-) (limited to 'test/functional/clipboard/clipboard_provider_spec.lua') diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index 941112d9ae..08055f61d8 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -93,17 +93,16 @@ describe('clipboard', function() local screen = Screen.new(72, 8) screen:attach() command("let g:clipboard = 'bogus'") - feed_command('redir @+> | :call system("cat CONTRIBUTING.md") | redir END') - -- it is made empty + feed_command('redir @+> | :silent echo system("cat CONTRIBUTING.md") | redir END') screen:expect([[ + ^ | + ~ | + ~ | + ~ | ~ | ~ | ~ | - Error detected while processing function provider#clipboard#Executable: | - line 5: | - clipboard: invalid g:clipboard | clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | - Press ENTER or type command to continue^ | ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) end) end) @@ -118,7 +117,23 @@ describe('clipboard', function() feed_command('call getreg("*")') -- force load of provider end) - it('has independent "* and unnamed registers per default', function() + it('`:redir @+>` invokes clipboard once-per-message', function() + eq(0, eval("g:clip_called_set")) + feed_command('redir @+> | :silent echo system("cat CONTRIBUTING.md") | redir END') + -- Assuming CONTRIBUTING.md has >100 lines. + assert(eval("g:clip_called_set") > 100) + end) + + it('`:redir @">` does not invoke clipboard', function() + -- :redir to a non-clipboard register, with `:set clipboard=unnamed`. + -- Does _not_ propagate to the clipboard (complies with Vim behavior). + command("set clipboard=unnamedplus") + eq(0, eval("g:clip_called_set")) + feed_command('redir @"> | :silent echo system("cat CONTRIBUTING.md") | redir END') + eq(0, eval("g:clip_called_set")) + end) + + it('has independent "* and unnamed registers per default', function() insert("some words") feed('^"*dwdw"*P') expect('some ') @@ -325,7 +340,7 @@ describe('clipboard', function() end) - describe('with clipboard=unnamedplus', function() + describe('clipboard=unnamedplus', function() before_each(function() feed_command('set clipboard=unnamedplus') end) @@ -369,6 +384,7 @@ describe('clipboard', function() really unnamed the plus]]) end) + it('is updated on global changes', function() insert([[ text -- cgit From 88165a798e7459fecf815a13c853949923d4b278 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 20 Aug 2017 22:17:03 +0200 Subject: clipboard: test g:clipboard validation, fix a bug Also fix `:help foo` highlighting in health.vim --- .../clipboard/clipboard_provider_spec.lua | 31 ++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'test/functional/clipboard/clipboard_provider_spec.lua') diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index 08055f61d8..e6544a8e2e 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -5,6 +5,7 @@ local Screen = require('test.functional.ui.screen') local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert local feed_command, expect, eq, eval = helpers.feed_command, helpers.expect, helpers.eq, helpers.eval local command = helpers.command +local meths = helpers.meths local function basic_register_test(noblock) insert("some words") @@ -90,7 +91,7 @@ describe('clipboard', function() end) it('`:redir @+>` with invalid g:clipboard shows error exactly once', function() - local screen = Screen.new(72, 8) + local screen = Screen.new(72, 5) screen:attach() command("let g:clipboard = 'bogus'") feed_command('redir @+> | :silent echo system("cat CONTRIBUTING.md") | redir END') @@ -99,12 +100,26 @@ describe('clipboard', function() ~ | ~ | ~ | - ~ | - ~ | - ~ | clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) end) + + it('invalid g:clipboard', function() + command("let g:clipboard = 'bogus'") + eq('', eval('provider#clipboard#Executable()')) + eq('clipboard: invalid g:clipboard', eval('provider#clipboard#Error()')) + end) + + it('valid g:clipboard', function() + -- provider#clipboard#Executable() only checks the structure. + meths.set_var('clipboard', { + ['name'] = 'clippy!', + ['copy'] = { ['+'] = 'any command', ['*'] = 'some other' }, + ['paste'] = { ['+'] = 'any command', ['*'] = 'some other' }, + }) + eq('clippy!', eval('provider#clipboard#Executable()')) + eq('', eval('provider#clipboard#Error()')) + end) end) describe('clipboard', function() @@ -124,16 +139,16 @@ describe('clipboard', function() assert(eval("g:clip_called_set") > 100) end) - it('`:redir @">` does not invoke clipboard', function() - -- :redir to a non-clipboard register, with `:set clipboard=unnamed`. - -- Does _not_ propagate to the clipboard (complies with Vim behavior). + it('`:redir @">` does NOT invoke clipboard', function() + -- :redir to a non-clipboard register, with `:set clipboard=unnamed` does + -- NOT propagate to the clipboard. This is consistent with Vim. command("set clipboard=unnamedplus") eq(0, eval("g:clip_called_set")) feed_command('redir @"> | :silent echo system("cat CONTRIBUTING.md") | redir END') eq(0, eval("g:clip_called_set")) end) - it('has independent "* and unnamed registers per default', function() + it('has independent "* and unnamed registers by default', function() insert("some words") feed('^"*dwdw"*P') expect('some ') -- cgit From 85f3084e21e112a34d891d90cfaf37a7de726866 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 22 Aug 2017 20:31:54 +0200 Subject: clipboard: disallow recursion; show hint only once (#7203) - Show hint only once per session. - provider#clipboard#Call(): prevent recursion - provider#clear_stderr(): use has_key(), because :silent! is still captured by :redir. closes #7184 --- .../clipboard/clipboard_provider_spec.lua | 45 ++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) (limited to 'test/functional/clipboard/clipboard_provider_spec.lua') diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index e6544a8e2e..f66fbf7c94 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -90,8 +90,9 @@ describe('clipboard', function() basic_register_test() end) - it('`:redir @+>` with invalid g:clipboard shows error exactly once', function() - local screen = Screen.new(72, 5) + it('`:redir @+>` with invalid g:clipboard shows exactly one error #7184', + function() + local screen = Screen.new(72, 4) screen:attach() command("let g:clipboard = 'bogus'") feed_command('redir @+> | :silent echo system("cat CONTRIBUTING.md") | redir END') @@ -99,15 +100,40 @@ describe('clipboard', function() ^ | ~ | ~ | + clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | + ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) + end) + + it('`:redir @+>|bogus_cmd|redir END` + invalid g:clipboard must not recurse #7184', + function() + local screen = Screen.new(72, 4) + screen:attach() + command("let g:clipboard = 'bogus'") + feed_command('redir @+> | bogus_cmd | redir END') + screen:expect([[ ~ | clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | + E492: Not an editor command: bogus_cmd | redir END | + Press ENTER or type command to continue^ | ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) end) - it('invalid g:clipboard', function() + it('invalid g:clipboard shows hint if :redir is not active', function() command("let g:clipboard = 'bogus'") eq('', eval('provider#clipboard#Executable()')) eq('clipboard: invalid g:clipboard', eval('provider#clipboard#Error()')) + + local screen = Screen.new(72, 4) + screen:attach() + command("let g:clipboard = 'bogus'") + -- Explicit clipboard attempt, should show a hint message. + feed_command('let @+="foo"') + screen:expect([[ + ^ | + ~ | + ~ | + clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | + ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) end) it('valid g:clipboard', function() @@ -148,6 +174,19 @@ describe('clipboard', function() eq(0, eval("g:clip_called_set")) end) + it('`:redir @+>|bogus_cmd|redir END` must not recurse #7184', + function() + local screen = Screen.new(72, 4) + screen:attach() + feed_command('redir @+> | bogus_cmd | redir END') + screen:expect([[ + ^ | + ~ | + ~ | + E492: Not an editor command: bogus_cmd | redir END | + ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) + end) + it('has independent "* and unnamed registers by default', function() insert("some words") feed('^"*dwdw"*P') -- cgit From 4b3e51d4ee3018cf59d81578e2320b79fb614652 Mon Sep 17 00:00:00 2001 From: Björn Linse Date: Tue, 10 Oct 2017 18:42:01 +0200 Subject: ops: save and restore clipboard batch status when entering cmdline window --- test/functional/clipboard/clipboard_provider_spec.lua | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/functional/clipboard/clipboard_provider_spec.lua') diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index f66fbf7c94..b90335e70a 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -392,6 +392,13 @@ describe('clipboard', function() eq('---', eval('getreg("*")')) end) + it('works in the cmdline window', function() + feed('q:itextyy') + eq({{'text', ''}, 'V'}, eval("g:test_clip['*']")) + command("let g:test_clip['*'] = [['star'], 'c']") + feed('p') + eq('textstar', meths.get_current_line()) + end) end) describe('clipboard=unnamedplus', function() -- cgit From d214df4e9b23b5f2d9f7e6c78624881a7d298cdb Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 15 Oct 2017 20:31:12 +0200 Subject: doc: replace ":CheckHealth" with ":checkhealth" --- test/functional/clipboard/clipboard_provider_spec.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/functional/clipboard/clipboard_provider_spec.lua') diff --git a/test/functional/clipboard/clipboard_provider_spec.lua b/test/functional/clipboard/clipboard_provider_spec.lua index b90335e70a..a3ea3b568f 100644 --- a/test/functional/clipboard/clipboard_provider_spec.lua +++ b/test/functional/clipboard/clipboard_provider_spec.lua @@ -100,7 +100,7 @@ describe('clipboard', function() ^ | ~ | ~ | - clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | + clipboard: No provider. Try ":checkhealth" or ":h clipboard". | ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) end) @@ -112,7 +112,7 @@ describe('clipboard', function() feed_command('redir @+> | bogus_cmd | redir END') screen:expect([[ ~ | - clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | + clipboard: No provider. Try ":checkhealth" or ":h clipboard". | E492: Not an editor command: bogus_cmd | redir END | Press ENTER or type command to continue^ | ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) @@ -132,7 +132,7 @@ describe('clipboard', function() ^ | ~ | ~ | - clipboard: No provider. Try ":CheckHealth" or ":h clipboard". | + clipboard: No provider. Try ":checkhealth" or ":h clipboard". | ]], nil, {{bold = true, foreground = Screen.colors.Blue}}) end) -- cgit