aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/movement.rs
Commit message (Collapse)AuthorAge
* Use requested direction for new textobject selection rangeMichael Davis2022-10-03
| | | | | | | | | | | | | | | | | | This changes the behavior of operations like `]f`/`[f` to set the direction of the new range to the direction of the action. The original behavior was to always use the head of the next function. This is inconsistent with the behavior of goto_next_paragraph and makes it impossible to create extend variants of the textobject motions. This causes a behavior change when there are nested functions. The behavior in the parent commit is that repeated uses of `]f` will select every function in the file even if nested. With this commit, functions are skipped. It's notable that it's possible to emulate the original behavior by using the `ensure_selections_forward` (A-:) command between invocations of `]f`.
* Fix typos (#3858)taupiqueur2022-09-17
|
* respect count in treesitter movement (#3058)Bob2022-07-14
|
* feat: make `move_vertically` aware of tabs and wide characters (#2620)Matthew Toohey2022-06-21
| | | | | | | | | | | | | * feat: make `move_vertically` aware of tabs and wide characters * refactor: replace unnecessary checked_sub with comparison * refactor: leave pos_at_coords unchanged and introduce separate pos_at_visual_coords * style: include comment to explain `pos_at_visual_coords` breaking condition * refactor: use `pos_at_visual_coords` in `text_pos_at_screen_coords` * feat: make `copy_selection_on_line` aware of wide characters
* Remove usage of format ident feature from tests (#2028)Michael Davis2022-04-08
|
* Fix next paragraph logic over muliple blank lines (#1951)Ivan Tham2022-04-05
| | | Fix #1928
* Rename _para to _paragraphIvan Tham2022-04-02
|
* Change test mark from ^@ to #[|]#Ivan Tham2022-04-02
|
* Add paragraph textobjectIvan Tham2022-04-02
| | | | | Change parameter/argument key from p to a since paragraph only have p but parameter are also called arguments sometimes and a is not used.
* Add next paragraphIvan Tham2022-04-02
|
* Add (prev) paragraph motionIvan Tham2022-04-02
| | | | | | Also improved testing facility. Fix #1580
* Add object.movement for tree-sitter navigationGokul Soumya2022-02-15
|
* Add tree-sitter based function, class navigationGokul Soumya2022-02-15
|
* Apply recent nightly suggestions (#1286)Kirawi2021-12-18
| | | array iterators are now implicit
* Add trim_selections command (#1092)ath32021-11-14
|
* Ensure coords in screen depends on char width (#885)Ivan Tham2021-11-03
| | | | | The issue affected files with lots of tabs at the start as well. Fix #840
* Fixes for new clippy lints in Rust 1.54.Nathan Vegdahl2021-07-29
|
* Minor cleanup of the vertical movement code.Nathan Vegdahl2021-07-27
|
* Use `match` for branching on the `Direction` enum in more places.Nathan Vegdahl2021-07-27
|
* Collect some common patterns into methods on `Range`.Nathan Vegdahl2021-07-26
|
* Switch to a cleaner range-head moving abstraction.Nathan Vegdahl2021-07-24
| | | | Also fix a bunch of bugs related to it.
* Revert display-width-based vertical cursor movement.Nathan Vegdahl2021-07-22
| | | | Still needs to be done, but should be part of a separate PR.
* Fixes for misc bugs with view movement.Nathan Vegdahl2021-07-21
|
* Handle edge case in `range_to_target()` correctly.Nathan Vegdahl2021-07-19
|
* Update word selection/navigation to work with gap indexing.Nathan Vegdahl2021-07-19
| | | | | | Also tweaked some of the existing behavior that seemed inconsistent and/or buggy. It's mostly identical, just a few corner cases are different.
* Update surround commands to work with gap indexing.Nathan Vegdahl2021-07-08
|
* Implement `Range::put()` which manages range movements and extensions.Nathan Vegdahl2021-07-08
| | | | | In particular, this wraps the annoying logic involved in keeping the cursor width to 1 grapheme.
* Merge branch 'master' into great_line_ending_and_cursor_range_cleanupNathan Vegdahl2021-07-06
|\
| * Add object selection (textobjects) (#385)Gokul Soumya2021-07-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add textobjects for word * Add textobjects for surround characters * Apply clippy lints * Remove ThisWordPrevBound in favor of PrevWordEnd It's the same as PrevWordEnd except for taking the current char into account, so use a "flag" to capture that usecase * Add tests for PrevWordEnd movement * Remove ThisWord* movements They did not preserve anchor positions and were only used for textobject boundary search anyway so replace them with simple position finding functions * Rewrite tests of word textobject * Add tests for surround textobject * Add textobject docs * Refactor textobject word position functions * Apply clippy lints on textobject * Fix overflow error with textobjects
* | Make vertical selection movement work properly.Nathan Vegdahl2021-07-06
| |
* | Make horizontal selection movement work properly.Nathan Vegdahl2021-07-02
| |
* | Allow last line in file to lack a line break character.Nathan Vegdahl2021-07-02
|/
* Fix all remaining warnings in helix-core except for two.Nathan Vegdahl2021-07-02
| | | | | I'm not sure how to address them, because they look like they might be bugs, and code is involved. Will poke the relevant people.
* 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.
* Incorporate long word commands into keymapPabloMansanet2021-06-29
|
* Add long word unit testsPabloMansanet2021-06-29
|
* Add long word motion implementationPabloMansanet2021-06-29
|
* Add function to get the line ending of a str slice.Nathan Vegdahl2021-06-21
| | | | This is needed in some places.
* Work on moving code over to LineEnding instead of assuming '\n'.Nathan Vegdahl2021-06-20
| | | | Also some general cleanup and some minor fixes along the way.
* Misc fixes and clean up of line ending detect code.Nathan Vegdahl2021-06-20
|
* added the line_end helper functionJan Hrastnik2021-06-20
|
* changed some hardcoded newlines, removed a else if in line_ending.rsJan Hrastnik2021-06-19
|
* Movement fixes, refactor and unit test suite (#217)PabloMansanet2021-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add convenience/clarity wrapper for Range initialization * Test horizontal moves * Add column jumping tests * Add failing movement conditions for multi-word moves * Refactor skip_over_next * Add complex forward movement unit tests * Add strict whitespace checks and edge case tests * Restore formatting * Remove unused function * Add empty test case for deletion and fix nth_prev_word_boundary * Add tests for backward motion * Refactor word movement * Address review comments and finish refactoring backwards move * Finish unit test suite * Fmt pass * Fix lint erors * Clean up diff restoring bad 'cargo fmt' actions * Simplify movement closures (thanks Pickfire) * Fmt pass * Replace index-based movement with iterator based movement, ensuring that each move incurs a single call to the RopeSlice API * Break down tuple function * Extract common logic to all movement functions * Split iterator helpers away into their own module * WIP reducing clones * Operate on spans * WIP simplifying iterators * Simplify motion helpers * Fix iterator * Fix all unit tests * Refactor and simplify * Simplify fold
* Derive debug without featureIvan Tham2021-06-10
| | | | Note that this also removed those `finish_non_exhaustive()`.
* Implement Debug for data structure as a featurenotoria2021-06-10
|
* Fix Unicode (#135)Kirawi2021-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * init * wip * wip * fix unicode break * fix unicode break * Update helix-core/src/transaction.rs Co-authored-by: Benoît Cortier <benoit.cortier@fried-world.eu> * clippy * fix * add changes * added test * wip * wip * wip * wip * fix * fix view * fix #88 Co-authored-by: Benoît Cortier <benoit.cortier@fried-world.eu>
* Fix panic when moving over unicode punctuationBenoît CORTIER2021-06-07
| | | | | | | | | | | | `is_ascii_punctuation` will only work for ASCII punctuations, and when we have unicode punctuation (or other) we jump into the `unreachable`. This patch fallback into categorizing everything in this branch as `Unknown`. Fixes https://github.com/helix-editor/helix/issues/123 https://github.com/helix-editor/helix/pull/135: add better support for unicode categories.
* Add ctrl-w in insert modeIvan Tham2021-06-06
| | | | | It seemed to panic when I pressed too many times, but that is from lsp side.
* Add unreachable contextIvan Tham2021-06-05
| | | Better error for #123
* Fixing Multiple Panics (#121)Kirawi2021-06-05
| | | | | | | * init * wip * wip