mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
feat(autocmd): populate v:event in RecordingLeave (#16828)
This commit is contained in:
@@ -11,7 +11,7 @@ describe('RecordingEnter', function()
|
||||
source_vim [[
|
||||
let g:recorded = 0
|
||||
autocmd RecordingEnter * let g:recorded += 1
|
||||
execute "normal! qqyyq"
|
||||
call feedkeys("qqyyq", 'xt')
|
||||
]]
|
||||
eq(1, eval('g:recorded'))
|
||||
end)
|
||||
@@ -20,7 +20,7 @@ describe('RecordingEnter', function()
|
||||
source_vim [[
|
||||
let g:recording = ''
|
||||
autocmd RecordingEnter * let g:recording = reg_recording()
|
||||
execute "normal! qqyyq"
|
||||
call feedkeys("qqyyq", 'xt')
|
||||
]]
|
||||
eq('q', eval('g:recording'))
|
||||
end)
|
||||
@@ -32,7 +32,7 @@ describe('RecordingLeave', function()
|
||||
source_vim [[
|
||||
let g:recorded = 0
|
||||
autocmd RecordingLeave * let g:recorded += 1
|
||||
execute "normal! qqyyq"
|
||||
call feedkeys("qqyyq", 'xt')
|
||||
]]
|
||||
eq(1, eval('g:recorded'))
|
||||
end)
|
||||
@@ -43,10 +43,30 @@ describe('RecordingLeave', function()
|
||||
let g:recording = ''
|
||||
autocmd RecordingLeave * let g:recording = reg_recording()
|
||||
autocmd RecordingLeave * let g:recorded = reg_recorded()
|
||||
execute "normal! qqyyq"
|
||||
call feedkeys("qqyyq", 'xt')
|
||||
]]
|
||||
eq('q', eval 'g:recording')
|
||||
eq('', eval 'g:recorded')
|
||||
eq('q', eval 'reg_recorded()')
|
||||
end)
|
||||
|
||||
it('populates v:event', function()
|
||||
source_vim [[
|
||||
let g:regname = ''
|
||||
let g:regcontents = ''
|
||||
autocmd RecordingLeave * let g:regname = v:event.regname
|
||||
autocmd RecordingLeave * let g:regcontents = v:event.regcontents
|
||||
call feedkeys("qqyyq", 'xt')
|
||||
]]
|
||||
eq('q', eval 'g:regname')
|
||||
eq('yy', eval 'g:regcontents')
|
||||
end)
|
||||
|
||||
it('resets v:event', function()
|
||||
source_vim [[
|
||||
autocmd RecordingLeave * let g:event = v:event
|
||||
call feedkeys("qqyyq", 'xt')
|
||||
]]
|
||||
eq(0, eval 'len(v:event)')
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user