mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
lua: fix infinite loop for vim.split on empty string (#12420)
This commit is contained in:
@@ -79,7 +79,7 @@ function vim.gsplit(s, sep, plain)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return function()
|
return function()
|
||||||
if done then
|
if done or s == '' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if sep == '' then
|
if sep == '' then
|
||||||
|
@@ -243,6 +243,7 @@ describe('lua stdlib', function()
|
|||||||
{ "here be dragons", " ", false, { "here", "be", "dragons"} },
|
{ "here be dragons", " ", false, { "here", "be", "dragons"} },
|
||||||
{ "axaby", "ab?", false, { '', 'x', 'y' } },
|
{ "axaby", "ab?", false, { '', 'x', 'y' } },
|
||||||
{ "f v2v v3v w2w ", "([vw])2%1", false, { 'f ', ' v3v ', ' ' } },
|
{ "f v2v v3v w2w ", "([vw])2%1", false, { 'f ', ' v3v ', ' ' } },
|
||||||
|
{ "", "", false, {} },
|
||||||
{ "x*yz*oo*l", "*", true, { 'x', 'yz', 'oo', 'l' } },
|
{ "x*yz*oo*l", "*", true, { 'x', 'yz', 'oo', 'l' } },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user