Compare commits

..

No commits in common. "1624866a1379fc1861797f0ed05899a9c1d2ff61" and "26c365cc7d58d0da17b13e747855d331eb26fcf0" have entirely different histories.

View File

@ -63,20 +63,7 @@ end
M.get_node_text = function(node)
local _, txt = pcall(get_node_text, node, vim.api.nvim_get_current_buf())
local texts = vim.split(txt, "\n")
local filtered = {}
-- For some nodes (tsx) 'vim.treesitter.get_node_text' can return empty lines or lines with spaces
-- We have to exclude them
for i = 1, #texts do
local text = texts[i]:gsub("^%s*(.-)%s*$", "%1")
if text ~= "" then
filtered[#filtered + 1] = text
end
end
return filtered or {}
return vim.split(txt, "\n") or {}
end
-- Stolen from nvim `0.10.0` for `0.9.5` users