Skip to content

Conversation

@Starslayerx
Copy link
Contributor

docs: specify nvim-treesitter main branch requirement

Update installation instructions to require nvim-treesitter's main branch,
which is recommended after migrating to Neovim's native treesitter APIs.

Starslayerx and others added 4 commits October 10, 2025 16:22
- Remove dependency on nvim-treesitter.ts_utils module
- Replace ts_utils.get_node_at_cursor() with vim.treesitter.get_node()
- Replace ts_utils.get_vim_range() with vim.treesitter.get_node_range()
- Replace ts_utils.get_node_text() with vim.treesitter.get_node_text()
- Add proper coordinate conversion from 0-based to 1-based indexing
- Ensure compatibility with modern nvim-treesitter versions
The previous migration incorrectly added +1 to end_col when converting
from treesitter's 0-based exclusive indexing to vim's 1-based inclusive
indexing. This caused selections to include an extra character on the
right side.

The correct conversion is:
- start_row, start_col, end_row: 0-based -> 1-based (add +1)
- end_col: 0-based exclusive == 1-based inclusive (no change needed)

This fixes the bug where selecting text inside brackets/quotes would
incorrectly include the closing bracket/quote character.
  - Replace deprecated parsers.get_parser() with vim.treesitter.get_parser(buf)
  - Add buffer/column bounds validation in unsurround_coordinates()
  - Add cursor position clamping in update_selection()
  - Use pcall for safe API calls and graceful error handling
  - Fix E5108 crashes on blank lines and unsupported filetypes
  - Add Neovim >= 0.9.0 requirement
  - Specify nvim-treesitter main branch dependency
  - Reflects migration from deprecated nvim-treesitter.ts_utils to vim.treesitter APIs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant