aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2021-12-18 08:55:43 -0700
committerGitHub <noreply@github.com>2021-12-18 08:55:43 -0700
commit36758ba9a78ecf01ab8f654be08051015932983a (patch)
tree727a197fe984e45e8c68b1c5d67fae4f693d3f5c /test/functional/editor
parent818ae74eaf6f4538ca61ee4ba703543b0caaff10 (diff)
parentdf50fb5859250fd90b6bceb1f741f39a370a5241 (diff)
downloadrneovim-36758ba9a78ecf01ab8f654be08051015932983a.tar.gz
rneovim-36758ba9a78ecf01ab8f654be08051015932983a.tar.bz2
rneovim-36758ba9a78ecf01ab8f654be08051015932983a.zip
autocmd: RecordingEnter, RecordingLeave (#16684)
Diffstat (limited to 'test/functional/editor')
-rw-r--r--test/functional/editor/macro_spec.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/editor/macro_spec.lua b/test/functional/editor/macro_spec.lua
index 102d8fc723..c0c9256af2 100644
--- a/test/functional/editor/macro_spec.lua
+++ b/test/functional/editor/macro_spec.lua
@@ -6,6 +6,8 @@ local feed = helpers.feed
local clear = helpers.clear
local expect = helpers.expect
local command = helpers.command
+local insert = helpers.insert
+local curbufmeths = helpers.curbufmeths
describe('macros', function()
before_each(clear)
@@ -27,4 +29,29 @@ describe('macros', function()
expect('llllll')
eq(eval('@i'), 'lxxx')
end)
+
+ it('can be replayed with Q', function()
+ insert [[hello
+hello
+hello]]
+ feed [[gg]]
+
+ feed [[qqAFOO<esc>q]]
+ eq({'helloFOO', 'hello', 'hello'}, curbufmeths.get_lines(0, -1, false))
+
+ feed[[Q]]
+ eq({'helloFOOFOO', 'hello', 'hello'}, curbufmeths.get_lines(0, -1, false))
+
+ feed[[G3Q]]
+ eq({'helloFOOFOO', 'hello', 'helloFOOFOOFOO'}, curbufmeths.get_lines(0, -1, false))
+ end)
+end)
+
+describe('reg_recorded()', function()
+ before_each(clear)
+
+ it('returns the correct value', function()
+ feed [[qqyyq]]
+ eq('q', eval('reg_recorded()'))
+ end)
end)