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.
This commit is contained in:
Peter Aronoff
2024-11-17 16:31:24 -05:00
committed by GitHub
parent 44229bb85b
commit cc6992f1ca
3 changed files with 78 additions and 8 deletions

View File

@@ -170,6 +170,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)
@@ -194,6 +218,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)