eval: let getreg() return valid list for an undefined register

vim-patch:7.4.1755
this prevents a crash when the list is used in setreg() later
This commit is contained in:
Björn Linse
2016-04-20 13:44:12 +02:00
parent a7a0bf54e3
commit ce17d03180
5 changed files with 36 additions and 14 deletions

View File

@@ -43,9 +43,9 @@ describe('ShaDa support code', function()
setreg('b', {'bca', 'abc', 'cba'}, 'b3')
nvim_command('qall')
reset()
eq({NIL, ''}, getreg('c'))
eq({NIL, ''}, getreg('l'))
eq({NIL, ''}, getreg('b'))
eq({{}, ''}, getreg('c'))
eq({{}, ''}, getreg('l'))
eq({{}, ''}, getreg('b'))
end)
it('does restore registers with zero <', function()
@@ -67,9 +67,9 @@ describe('ShaDa support code', function()
setreg('b', {'bca', 'abc', 'cba'}, 'b3')
nvim_command('qall')
reset()
eq({NIL, ''}, getreg('c'))
eq({NIL, ''}, getreg('l'))
eq({NIL, ''}, getreg('b'))
eq({{}, ''}, getreg('c'))
eq({{}, ''}, getreg('l'))
eq({{}, ''}, getreg('b'))
end)
it('does restore registers with zero "', function()
@@ -103,7 +103,7 @@ describe('ShaDa support code', function()
nvim_command('qall')
reset()
eq({{'d'}, 'v'}, getreg('o'))
eq({NIL, ''}, getreg('t'))
eq({{}, ''}, getreg('t'))
end)
it('does limit number of lines according to "', function()
@@ -113,7 +113,7 @@ describe('ShaDa support code', function()
nvim_command('qall')
reset()
eq({{'d'}, 'v'}, getreg('o'))
eq({NIL, ''}, getreg('t'))
eq({{}, ''}, getreg('t'))
end)
it('does limit number of lines according to < rather then "', function()
@@ -125,7 +125,7 @@ describe('ShaDa support code', function()
reset()
eq({{'d'}, 'v'}, getreg('o'))
eq({{'a', 'b', 'cde'}, 'V'}, getreg('t'))
eq({NIL, ''}, getreg('h'))
eq({{}, ''}, getreg('h'))
end)
it('dumps and loads register correctly when &encoding is not UTF-8',