summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/incremental_selection.lua
AgeCommit message (Collapse)Author
2022-08-02fix: node_incremental for incremental selection jumping around (#3257)itepechi / いてぺち
2022-07-31docs: add descriptions to incremental_selection keymapsStephan Seitz
2021-09-24Use vim-range style (1-index based) when possible (#1841)Santos Gallegos
https://github.com/nvim-treesitter/nvim-treesitter/pull/1829 half fixed incremental selection for the vim parser, but other bugs still remain (infinite selection and skip selecting the root node). Problems can be replicated with these two files: (missing selecting the root node) ```vim set scrolloff=7 set scrolloff=7 ``` (infinite loop) ```vim set scrolloff=7 ``` The main problem is that we try to map the current selection range to a TS range, but the TS range of a node could include the EOL/EOL marks so it's impossible to know when to change the vim range to match the TS range, is more easy to transform the TS range to a vim range and do the comparison.
2021-07-04Use stylua for autoformat code (#1480)Santos Gallegos
2021-04-22feat(incremental_selection): don't require localsThomas Vigouroux
2021-04-05Fix incremental selection (#1135)Santos Gallegos
So, there are two problems: - There was an infinite loop when inc selection was initiated from an injection. - The comparison was wrong when the whole file was selected, this is because ts matches the EOF. This is an extra line with one char (EOF). I put a workaround to try to select the node from the main tree, but we should try to select the node from the parent tree of the injection, but I wasn't able to get the parent tree from the node.
2020-11-23fix: update interface following languagetree merge (#687)Thomas Vigouroux
2020-11-03parser: only use parse to get a treeThomas Vigouroux
This will avoid using internal data.
2020-09-07Incremental selection: fix skipping some nodesSantos Gallegos
The range from ts nodes are a little different than neovim's nodes. They start at 0 and the end is exclusive. For example, a nvim range (1, 3, 2, 4) is the equivalent to the ts range (0, 2, 1, 4). Since we may hit parent nodes that have the same range as its child, we skip those till we find one that actually changes the selection (since this is the relevant part for the user). Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/232
2020-09-01use xmap in detachevakuator
2020-09-01use xmap instead of vmap in textobjectsevakuator
2020-08-22fix(modules): do not reattach if already attachedSteven Sojka
2020-08-06Add noremap option to mappingsRafał Camlet
2020-08-02fix decremental selectionkiyan42
2020-07-16Refactor locals.lua:Stephan Seitz
- shared query group stuff -> query.lua - local-specific stuff from ts_utils -> locals.lua
2020-07-14Add textobjects moduleStephan Seitz
2020-07-05Make luacheck happyStephan Seitz
2020-06-19refacto: remove buf_statekiyan42
- remove buf_state and related code - add get_node_at_cursor() - better incremental selection (code is localized)
2020-05-22Remove postspaces and avoid one globalStephan Seitz
2020-05-12refacto/feat: better handling of parser updateskiyan42
features: - node_movement is moving between scopes. - add selection initialization from normal mode - add a decremental selection improvements: - attach to buffer to run tree parsing on change - run state update on CursorMoved - the buffer state is: ``` { cursor_pos = { row=row, col=col }, current_node = node_under_cursor, selection = { range = nil, -- activates when starting a selection nodes = {} -- filling up when starting an incremental selection }, parser = parser, -- parser for current buffer } ``` - refacto all the modules reliant on parsing the tree, update the current nodes, get the current nodes... fixes: - fix has_parser to look for .so libraries - fix should select the whole file when selection root in selection
2020-05-02modules: move textobj to incremental_selectionThomas Vigouroux
As suggested in #37, rename the textobj module to incremental_selection. Also adds a utility function to get the config of a module.