aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Aronoff <peter@aronoff.org>2024-11-17 16:31:24 -0500
committerGitHub <noreply@github.com>2024-11-17 13:31:24 -0800
commitcc6992f1ca443f4da01cb4d57159d4cef37b36b7 (patch)
tree3b51134d7e6190637daff3db1d274159118ed6e4 /test
parent44229bb85b6cff00193164967126d85a7a785a7b (diff)
downloadrneovim-cc6992f1ca443f4da01cb4d57159d4cef37b36b7.tar.gz
rneovim-cc6992f1ca443f4da01cb4d57159d4cef37b36b7.tar.bz2
rneovim-cc6992f1ca443f4da01cb4d57159d4cef37b36b7.zip
feat(defaults): dot-repeat [<Space> #31186
Problem: `[<Space>` and `]<Space>` do not support repetition. Solution: use `operatorfunc` and `g@l` to make these mappings dot repeatable.
Diffstat (limited to 'test')
-rw-r--r--test/functional/editor/defaults_spec.lua47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/functional/editor/defaults_spec.lua b/test/functional/editor/defaults_spec.lua
index 7110d216f8..82d285cc9a 100644
--- a/test/functional/editor/defaults_spec.lua
+++ b/test/functional/editor/defaults_spec.lua
@@ -172,6 +172,30 @@ describe('default', function()
first line]])
end)
+
+ it('supports dot repetition', function()
+ n.clear({ args_rm = { '--cmd' } })
+ n.insert([[first line]])
+ n.feed('[<Space>')
+ n.feed('.')
+ n.expect([[
+
+
+ first line]])
+ end)
+
+ it('supports dot repetition and a count', function()
+ n.clear({ args_rm = { '--cmd' } })
+ n.insert([[first line]])
+ n.feed('[<Space>')
+ n.feed('3.')
+ n.expect([[
+
+
+
+
+ first line]])
+ end)
end)
describe(']<Space>', function()
@@ -196,6 +220,29 @@ describe('default', function()
]])
end)
+
+ it('supports dot repetition', function()
+ n.clear({ args_rm = { '--cmd' } })
+ n.insert([[first line]])
+ n.feed(']<Space>')
+ n.feed('.')
+ n.expect([[
+ first line
+
+ ]])
+ end)
+
+ it('supports dot repetition and a count', function()
+ n.clear({ args_rm = { '--cmd' } })
+ n.insert([[first line]])
+ n.feed(']<Space>')
+ n.feed('2.')
+ n.expect([[
+ first line
+
+
+ ]])
+ end)
end)
end)
end)