A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/afcf64479c1aa5ea53286853370082507f2721f7 below:

check empty table for lines · neovim/neovim@afcf644 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+7

-5

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+7

-5

lines changed Original file line number Diff line number Diff line change

@@ -199,11 +199,13 @@ function M.get_node_text(node, source)

199 199

lines = a.nvim_buf_get_lines(source, start_row, end_row + 1, true)

200 200

end

201 201 202 -

if #lines == 1 then

203 -

lines[1] = string.sub(lines[1], start_col+1, end_col)

204 -

else

205 -

lines[1] = string.sub(lines[1], start_col+1)

206 -

lines[#lines] = string.sub(lines[#lines], 1, end_col)

202 +

if #lines > 0 then

203 +

if #lines == 1 then

204 +

lines[1] = string.sub(lines[1], start_col+1, end_col)

205 +

else

206 +

lines[1] = string.sub(lines[1], start_col+1)

207 +

lines[#lines] = string.sub(lines[#lines], 1, end_col)

208 +

end

207 209

end

208 210 209 211

return table.concat(lines, "\n")

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4