aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorMatthew Malcomson <hardenedapple@gmail.com>2017-05-31 12:20:06 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-05-31 13:20:06 +0200
commit033b1cb7d9837699aba14ca1c0bda0058edc79fd (patch)
tree69a0dcfec36edeb2d6bab3cf97f022e64a21a518 /test/functional
parent43f40b8e1acafa55e1c8df7c08c91a042f834f97 (diff)
downloadrneovim-033b1cb7d9837699aba14ca1c0bda0058edc79fd.tar.gz
rneovim-033b1cb7d9837699aba14ca1c0bda0058edc79fd.tar.bz2
rneovim-033b1cb7d9837699aba14ca1c0bda0058edc79fd.zip
'pastetoggle': Revert support for multi-key value (#6724)
Reverts commit 337b6179df852350b52409fd3806e4b47ab2875b Closes #6716 at the expense of not being able to use a multi-key 'pastetoggle' manually. Multi-key 'pastetoggle' can still be used when inserting the entire option into the typebuffer at once (though the use here is questionable). Also remove those tests to do with waiting for the completion of 'pastetoggle' and mention in the documentation that 'pastetoggle' doesn't wait for timeout.
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/options/pastetoggle_spec.lua35
1 files changed, 19 insertions, 16 deletions
diff --git a/test/functional/options/pastetoggle_spec.lua b/test/functional/options/pastetoggle_spec.lua
index ec3c60fe37..a1f86f73ff 100644
--- a/test/functional/options/pastetoggle_spec.lua
+++ b/test/functional/options/pastetoggle_spec.lua
@@ -6,32 +6,35 @@ local command = helpers.command
local eq = helpers.eq
local eval = helpers.eval
local sleep = helpers.sleep
+local expect = helpers.expect
describe("'pastetoggle' option", function()
before_each(function()
clear()
command('set nopaste')
- command('set pastetoggle=a')
end)
+
it("toggles 'paste'", function()
- eq(eval('&paste'), 0)
+ command('set pastetoggle=a')
+ eq(0, eval('&paste'))
feed('a')
-- Need another key so that the vgetorpeek() function returns.
feed('j')
- eq(eval('&paste'), 1)
+ eq(1, eval('&paste'))
end)
- it("multiple key 'pastetoggle' is waited for", function()
- eq(eval('&paste'), 0)
- local pastetoggle = 'lllll'
- command('set pastetoggle=' .. pastetoggle)
- command('set timeoutlen=1 ttimeoutlen=10000')
- 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(eval('&paste'), 1)
+
+
+ it('does not wait for timeout', function()
+ command('set pastetoggle=abc')
+ command('set ttimeoutlen=9999999')
+ eq(0, eval('&paste'))
+ -- n.b. need <esc> to return from vgetorpeek()
+ feed('abc<esc>')
+ eq(1, eval('&paste'))
+ feed('ab')
+ sleep(10)
+ feed('c<esc>')
+ expect('bc')
+ eq(1, eval('&paste'))
end)
end)