mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
fix(lsp): properly handle nil
lines when trimming empty lines (#15325)
This commit is contained in:
@@ -1719,14 +1719,14 @@ end
|
||||
function M.trim_empty_lines(lines)
|
||||
local start = 1
|
||||
for i = 1, #lines do
|
||||
if #lines[i] > 0 then
|
||||
if lines[i] ~= nil and #lines[i] > 0 then
|
||||
start = i
|
||||
break
|
||||
end
|
||||
end
|
||||
local finish = 1
|
||||
for i = #lines, 1, -1 do
|
||||
if #lines[i] > 0 then
|
||||
if lines[i] ~= nil and #lines[i] > 0 then
|
||||
finish = i
|
||||
break
|
||||
end
|
||||
|
Reference in New Issue
Block a user