get_node_text()
behaves differently between buffer and string sources on EOL char
#28677
Labels
bug
issues reporting wrong behavior
complexity:low
Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md
treesitter
Milestone
Problem
If a treesitter node range's
end_col
is0
,vim.treesitter.get_node_text()
will not return the trailing new line char for buffer source.Steps to reproduce
test.lua:
Node ranges are same, but the result of get_node_text() is different.
Expected behavior
get_node_text()
on buffers returns the trailing newline char, or does not return newline char on string sources, to make it consistent.Neovim version (nvim -v)
NVIM v0.9.5 & NVIM v0.10.0-dev-d3fa88b
Vim (not Nvim) behaves the same?
no
Operating system/version
Linux
Terminal name/version
kitty 0.34.1
$TERM environment variable
xterm-kitty
Installation
nixpkgs
The text was updated successfully, but these errors were encountered: