mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
fix(filetype.lua): always return a string in getlines function (#19080)
This re-introduces the fix that the filetype.lua refactor inadvertently reverted. The fix ensures that in the case when end_lnum is omitted, a string is always returned.
This commit is contained in:
@@ -33,7 +33,7 @@ end
|
||||
function M.getlines(bufnr, start_lnum, end_lnum)
|
||||
if not end_lnum then
|
||||
-- Return a single line as a string
|
||||
return api.nvim_buf_get_lines(bufnr, start_lnum - 1, start_lnum, false)[1]
|
||||
return api.nvim_buf_get_lines(bufnr, start_lnum - 1, start_lnum, false)[1] or ''
|
||||
end
|
||||
return api.nvim_buf_get_lines(bufnr, start_lnum - 1, end_lnum, false)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user