aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/object.rs
Commit message (Collapse)AuthorAge
* Reimplement tree motions in terms of syntax::TreeCursorMichael Davis2024-03-23
| | | | | | | This uses the new TreeCursor type from the parent commit to reimplement the tree-sitter motions (`A-p/o/i/n`). Other tree-sitter related features like textobjects are not touched with this change and will need a different, unrelated approach to solve.
* Fix edge-case in tree-sitter expand_selection selection command (#2877)Triton1712022-06-25
| | | Co-authored-by: Triton171 <triton0171@gmail.com>
* add select_next_sibling and select_prev_sibling commands (#1495)Michael Davis2022-01-20
| | | | | | | | | | | | | | | | | | | * add select_next_sibling and select_prev_sibling commands * refactor objects to use higher order functions * address clippy feedback * move selection cloning into commands * add default keybindings under left/right brackets * use [+t,]+t for selecting sibling syntax nodes * setup Alt-{j,k,h,l} default keymaps for syntax selection commands * reduce boilerplate of select_next/prev_sibling in commands * import tree-sitter Node type in commands
* expand_selection to current node with no children (#1454)Michael Davis2022-01-08
|
* feat(commands): shrink_selection (#1340)Matouš Dzivjak2022-01-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * feat(commands): shrink_selection Add `shrink_selection` command that can be used to shrink previously expanded selection. To make `shrink_selection` work it was necessary to add selection history to the Document since we want to shrink the selection towards the syntax tree node that was initially selected. Selection history is cleared any time the user changes selection other way than by `expand_selection`. This ensures that we don't get some funky edge cases when user calls `shrink_selection`. Related: https://github.com/helix-editor/helix/discussions/1328 * Refactor shrink_selection, move history to view * Remove useless comment * Add default key mapping for extend&shrink selection * Rework contains_selection method * Shrink selection without expand selects first child
* select smaller range on some casecossonleo2021-10-29
|
* Merge branch 'master' into great_line_ending_and_cursor_range_cleanupNathan Vegdahl2021-07-02
|\
| * Remove #[allow(unused)] from helix-core, and fix unused imports.Nathan Vegdahl2021-07-02
| | | | | | | | Still a bunch more warnings to fix in core, but it's a start.
* | Make `Selection`'s normalize and transform methods self-consuming only.Nathan Vegdahl2021-07-01
| |
* | Clean up `Selection` to not use so many allocations.Nathan Vegdahl2021-07-01
|/
* minor: Remove a few unwraps.Blaž Hrastnik2021-03-26
|
* commands: Implement expand_selection.Blaž Hrastnik2021-02-22