mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 08:32:42 +00:00
functests: Test loading last search/substitute pattern/replacement
This commit is contained in:
@@ -102,4 +102,26 @@ describe('ShaDa support code', function()
|
|||||||
eq('Test 2', nvim_eval('histget("@", -1)'))
|
eq('Test 2', nvim_eval('histget("@", -1)'))
|
||||||
eq('c', nvim_eval('histget(">", -1)'))
|
eq('c', nvim_eval('histget(">", -1)'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('dumps and loads last search pattern with offset', function()
|
||||||
|
nvim_eval('setline(".", ["foo", "bar"])')
|
||||||
|
nvim_feed('gg0/a/e+1\n')
|
||||||
|
eq({0, 2, 3, 0}, nvim_eval('getpos(".")'))
|
||||||
|
nvim_command('wviminfo')
|
||||||
|
reset()
|
||||||
|
nvim_eval('setline(".", ["foo", "bar"])')
|
||||||
|
nvim_feed('gg0n')
|
||||||
|
eq({0, 2, 3, 0}, nvim_eval('getpos(".")'))
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('dumps and loads last substitute pattern and replacement string', function()
|
||||||
|
nvim_eval('setline(".", ["foo", "bar"])')
|
||||||
|
nvim_command('%s/f/g/g')
|
||||||
|
eq('goo', nvim_eval('getline(1)'))
|
||||||
|
nvim_command('wviminfo')
|
||||||
|
reset()
|
||||||
|
nvim_eval('setline(".", ["foo", "bar"])')
|
||||||
|
nvim_command('&')
|
||||||
|
eq('goo', nvim_eval('getline(1)'))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user