aboutsummaryrefslogtreecommitdiff
path: root/test/functional/options/keymap_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/options/keymap_spec.lua')
-rw-r--r--test/functional/options/keymap_spec.lua35
1 files changed, 19 insertions, 16 deletions
diff --git a/test/functional/options/keymap_spec.lua b/test/functional/options/keymap_spec.lua
index c390e3d943..7be58888bc 100644
--- a/test/functional/options/keymap_spec.lua
+++ b/test/functional/options/keymap_spec.lua
@@ -1,6 +1,6 @@
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, eq = helpers.clear, helpers.feed, helpers.eq
-local expect, command, eval = helpers.expect, helpers.command, helpers.eval
+local expect, command, eval = helpers.expect, helpers.command, helpers.eval
local insert, call = helpers.insert, helpers.call
local exec_capture, dedent = helpers.exec_capture, helpers.dedent
@@ -10,7 +10,7 @@ describe("'keymap' / :lmap", function()
clear()
before_each(function()
clear()
- insert("lllaaa")
+ insert('lllaaa')
command('set iminsert=1')
command('set imsearch=1')
command('lmap l a')
@@ -31,7 +31,8 @@ describe("'keymap' / :lmap", function()
command('set keymap=dvorak')
command('set nomore')
local bindings = exec_capture('lmap')
- eq(dedent([[
+ eq(
+ dedent([[
l " @_
l ' @-
@@ -104,20 +105,22 @@ describe("'keymap' / :lmap", function()
l z @;
l { @?
l | @|
- l } @+]]), bindings)
+ l } @+]]),
+ bindings
+ )
end)
end)
describe("'iminsert' option", function()
- it("Uses :lmap in insert mode when ON", function()
+ it('Uses :lmap in insert mode when ON', function()
feed('il<esc>')
expect('alllaaa')
end)
- it("Ignores :lmap in insert mode when OFF", function()
+ it('Ignores :lmap in insert mode when OFF', function()
command('set iminsert=0')
feed('il<esc>')
expect('llllaaa')
end)
- it("Can be toggled with <C-^> in insert mode", function()
+ it('Can be toggled with <C-^> in insert mode', function()
feed('i<C-^>l<C-^>l<esc>')
expect('lalllaaa')
eq(1, eval('&iminsert'))
@@ -126,16 +129,16 @@ describe("'keymap' / :lmap", function()
end)
end)
describe("'imsearch' option", function()
- it("Uses :lmap at search prompt when ON", function()
+ it('Uses :lmap at search prompt when ON', function()
feed('/lll<cr>3x')
expect('lll')
end)
- it("Ignores :lmap at search prompt when OFF", function()
+ it('Ignores :lmap at search prompt when OFF', function()
command('set imsearch=0')
feed('gg/lll<cr>3x')
expect('aaa')
end)
- it("Can be toggled with C-^", function()
+ it('Can be toggled with C-^', function()
eq(1, eval('&imsearch'))
feed('/<C-^>lll<cr>3x')
expect('aaa')
@@ -156,28 +159,28 @@ describe("'keymap' / :lmap", function()
eq(0, eval('&iminsert'))
end)
end)
- it(":lmap not applied to macros", function()
+ it(':lmap not applied to macros', function()
command("call setreg('a', 'il')")
feed('@a')
expect('llllaaa')
eq('il', call('getreg', 'a'))
end)
- it(":lmap applied to macro recording", function()
+ it(':lmap applied to macro recording', function()
feed('qail<esc>q@a')
expect('aalllaaa')
eq('ia', call('getreg', 'a'))
end)
- it(":lmap not applied to mappings", function()
+ it(':lmap not applied to mappings', function()
command('imap t l')
feed('it<esc>')
expect('llllaaa')
end)
- it("mappings applied to keys created with :lmap", function()
+ it('mappings applied to keys created with :lmap', function()
command('imap a x')
feed('il<esc>')
expect('xlllaaa')
end)
- it("mappings not applied to keys gotten with :lnoremap", function()
+ it('mappings not applied to keys gotten with :lnoremap', function()
command('lmapclear')
command('lnoremap l a')
command('imap a x')
@@ -196,7 +199,7 @@ describe("'keymap' / :lmap", function()
feed('@a')
expect('aalllaaa')
end)
- it("is applied when using f/F t/T", function()
+ it('is applied when using f/F t/T', function()
feed('flx')
expect('lllaa')
feed('0ia<esc>4lFlx')