diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /test/functional/options/pastetoggle_spec.lua | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-aucmd_textputpost.tar.gz rneovim-aucmd_textputpost.tar.bz2 rneovim-aucmd_textputpost.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/options/pastetoggle_spec.lua')
-rw-r--r-- | test/functional/options/pastetoggle_spec.lua | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/test/functional/options/pastetoggle_spec.lua b/test/functional/options/pastetoggle_spec.lua deleted file mode 100644 index 40c14fa187..0000000000 --- a/test/functional/options/pastetoggle_spec.lua +++ /dev/null @@ -1,90 +0,0 @@ -local helpers = require('test.functional.helpers')(after_each) - -local clear = helpers.clear -local feed = helpers.feed -local command = helpers.command -local eq = helpers.eq -local expect = helpers.expect -local eval = helpers.eval -local insert = helpers.insert -local meths = helpers.meths -local sleep = helpers.sleep - -describe("'pastetoggle' option", function() - before_each(clear) - it("toggles 'paste'", function() - command('set pastetoggle=a') - eq(0, eval('&paste')) - feed('a') - -- Need another key so that the vgetorpeek() function returns. - feed('j') - eq(1, eval('&paste')) - end) - describe("multiple key 'pastetoggle'", function() - before_each(function() - eq(0, eval('&paste')) - command('set timeoutlen=1 ttimeoutlen=10000') - end) - it('is waited for when chars are typed', function() - local pastetoggle = 'lllll' - command('set pastetoggle=' .. pastetoggle) - feed(pastetoggle:sub(0, 2)) - -- sleep() for long enough that vgetorpeek() is gotten into, but short - -- enough that ttimeoutlen is not reached. - sleep(200) - feed(pastetoggle:sub(3, -1)) - -- Need another key so that the vgetorpeek() function returns. - feed('j') - eq(1, eval('&paste')) - end) - - it('is not waited for when there are no typed chars after mapped chars', function() - command('set pastetoggle=abc') - command('imap d a') - meths.feedkeys('id', 't', true) - -- sleep() for long enough that vgetorpeek() is gotten into, but short - -- enough that ttimeoutlen is not reached. - sleep(200) - feed('bc') - -- Need another key so that the vgetorpeek() function returns. - feed('j') - -- 'ttimeoutlen' should NOT apply - eq(0, eval('&paste')) - end) - - it('is waited for when there are typed chars after mapped chars', function() - command('set pastetoggle=abc') - command('imap d a') - meths.feedkeys('idb', 't', true) - -- sleep() for long enough that vgetorpeek() is gotten into, but short - -- enough that ttimeoutlen is not reached. - sleep(200) - feed('c') - -- Need another key so that the vgetorpeek() function returns. - feed('j') - -- 'ttimeoutlen' should apply - eq(1, eval('&paste')) - end) - - it('is waited for when there are typed chars after noremapped chars', function() - command('set pastetoggle=abc') - command('inoremap d a') - meths.feedkeys('idb', 't', true) - -- sleep() for long enough that vgetorpeek() is gotten into, but short - -- enough that ttimeoutlen is not reached. - sleep(200) - feed('c') - -- Need another key so that the vgetorpeek() function returns. - feed('j') - -- 'ttimeoutlen' should apply - eq(1, eval('&paste')) - end) - end) - it('does not interfere with character-find', function() - insert('foo,bar') - feed('0') - command('set pastetoggle=,sp') - feed('dt,') - expect(',bar') - end) -end) |