aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/treesitter/_select.lua
Commit message (Collapse)AuthorAge
* fix(lua): enable param-type-mismatch diagnosticLewis Russell2026-09-28
| | | | | | | | | Problem: Argument type mismatches are excluded from EmmyLua checks. Solution: Correct runtime annotations and calls, document local checker workarounds, and enable the diagnostic. AI-assisted
* fix(lua): enable unnecessary-assert diagnosticLewis Russell2026-09-28
| | | | AI-assisted
* fix(editor)!: operator target/cgn modifies Visual marks #42119Justin M. Keyes2026-09-27
| | | | | | | | | | | | | | | | | | Problem: An operator on a target that creates a Visual selection (`cgn`, `d<C-v>j`, an omap text object like `:<C-U>normal! viw`) sets `'< '>`, `gv` and `visualmode()` to the operator target. This causes at least the following problems: - clobbers the user's previous `'< '>` (annoying and usually unwanted) - E.g. after a custom textobj, `:help text-object-define`. - "cgn" with a `\%V` pattern can't be dot-repeated (".") Solution: Don't save the Visual area if the operator target created it (operator was pending). Also fix `an`/`in` with `'selection'=exclusive` starting from an empty range.
* fix(lua): enable assignment type checking in runtime codeLewis Russell2026-09-25
| | | | | | | | | | | Enable EmmyLua's assign-type-mismatch diagnostic after correcting the runtime annotations and assignments it flags. Correct option, tuple, and return types, and use separate locals when a value changes representation. Add guards and narrow casts where needed so the runtime passes the stricter check. Regenerate the affected docs. AI-assisted
* fix(lua): add missing param annotations (#41911)Lewis Russell2026-09-15
|
* build: enable more EmmyLua checksLewis Russell2026-09-08
| | | | | | | | | | | | | | | | - call-non-callable - missing-fields - redefined-label - redefined-local - undefined-field - unreachable-code Promote redefined-local and unreachable-code to warnings. Fix DOS line-ending handling for multiline semantic tokens, and support intersection types in the help parser. AI-assisted
* fix(treesitter): handle `&selection=exclusive`altermo2026-08-01
|
* refactor: combine all visual_selection funcionsaltermo2026-08-01
|
* fix(treesitter): incremental selection: "vin" not always starts "v" #41016altermo2026-07-28
|
* perf(treesitter): reduce memory usage of _select.lua #40409Dmytro Meleshko2026-06-25
| | | | | | | | | | Problem: The table `history` in treesitter/_select.lua stores references to previously selected TSNodes, but a TSNode needs to keep its whole TSTree alive in memory, which may be kept alive even after closing the buffer to which this history corresponds. Solution: Store just the bits of information from the TSNode we need to go back in selection history (the range and ID), without referencing the TSNode itself.
* fix(treesitter): incremental selection causes beeps when the bell is enabled ↵Dmytro Meleshko2026-06-25
| | | | | | | | | | | #40414 Problem: The function visual_select() in treesitter/_select.lua is executing `:normal! v<Esc>` to ensure that `gv` later goes back to character Visual mode, but doing so when mode() is already `v` first switches back to the Normal mode, then executes <Esc>, which causes a beep. Solution: Check if the mode() is already `v` and avoid any switching in that case.
* feat(treesitter): expand selection to sibling node #38938altermo2026-04-22
| | | | | | | | | Problem: Can't expand treesitter-incremental-selection to the next and previous sibling nodes. Solution: Pressing `]N` in visual mode will expand the selection to the next sibling node, and `[N` will do the same with the previous node.
* fix(treesitter): TSNode:id() with NUL byte causes unreliable select() #39134altermo2026-04-16
| | | | | | | | | | | Problem: `TSNode:id()` returns the underlying c pointer as a string, which may include NUL bytes. In PUC Lua, `('%s'):format('\0a\0')` returns `''` and not `'\0a\0'` (i.e. treats the string as a c-string (which terminates at the NUL byte)). This resulted in two different nodes being able to have the same id. Solution: Use concatenation `..` instead of `string.format()`.
* fix(treesitter): select reset to "v" visualmode()altermo2026-04-02
|
* fix(treesitter): select with node ending with unicode char (#38557)altermo2026-03-31
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor(treesitter): use same visual-select as lsp #38475altermo2026-03-25
| | | | | | | Problem treesitter select over-complicates visual selection. Solution make it use same visual selection logic as lsp.
* refactor(treesitter): move range related functionsaltermo2026-03-14
|
* feat(treesitter): incremental selectionaltermo2026-03-08
Co-authored-by: György Andorka <gyorgy.andorka@protonmail.com>