aboutsummaryrefslogtreecommitdiff
path: root/runtime/indent/javascriptreact.vim
diff options
context:
space:
mode:
authorDavid Balatero <dbalatero@gmail.com>2026-05-03 09:23:32 -0400
committerGitHub <noreply@github.com>2026-05-03 09:23:32 -0400
commit7ed5609439ba83d75e972beb859245d998df09ea (patch)
tree15827a10e1f01558f225244f074536f8abca1df9 /runtime/indent/javascriptreact.vim
parent14819d55fbca18ef70638cce38318fe6bc4b32dc (diff)
downloadrneovim-7ed5609439ba83d75e972beb859245d998df09ea.tar.gz
rneovim-7ed5609439ba83d75e972beb859245d998df09ea.tar.bz2
rneovim-7ed5609439ba83d75e972beb859245d998df09ea.zip
fix(treesitter): get_node_text() inconsistent trailing newline #39409
Problem: `get_node_text()` returned inconsistent results between buffer and string sources when a node's range ends at `end_col == 0` (i.e. the node ends with a newline). The buffer path dropped the trailing newline; the string path included it correctly. Solution: Append `'\n'` in `buf_range_get_text()` when `end_col == 0` and `start_row ~= end_row`. The `start_row ~= end_row` guard excludes zero-width nodes at column 0, which should return `""`. Remove the workaround in the `#trim!` directive that manually compensated for the missing newline. Strip whitespace in `resolve_lang()` so injection language nodes ending at `end_col == 0` (e.g. `">lua\n"`) still resolve correctly.
Diffstat (limited to 'runtime/indent/javascriptreact.vim')
0 files changed, 0 insertions, 0 deletions