aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/surround.rs
Commit message (Collapse)AuthorAge
* Add test cases for existing pair matching logic. (#6027)Kyle Smith2023-03-08
| | | | | * Add test cases for existing pair matching logic. * fix clippy
* Make `m` textobject look for pairs enclosing selections (#3344)Daniel S Poulin2023-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make `m` textobject look for pairs enclosing selections Right now, this textobject only looks for pairs that surround the cursor. This ensures that the pair found encloses each selection, which is likely to be intuitively what is expected of this textobject. * Simplification of match code Co-authored-by: Michael Davis <mcarsondavis@gmail.com> * Adjust logic for ensuring surround range encloses selection Prior, it was missing the case where the start of the selection came before the opening brace. We also had an off-by-one error where if the end of the selection was on the closing brace it would not work. * Refactor to search for the open pair specifically to avoid edge cases * Adjust wording of autoinfo to reflect new functionality * Implement tests for surround functionality in new integration style * Fix handling of skip values * Fix out of bounds error * Add `ma` version of tests * Fix formatting of tests * Reduce indentation levels for readability, and update comments * Preserve each selection's direction with enclosing pair surround * Add test case for multiple cursors resulting in overlap * Mark known failures as TODO * Make tests multi-threaded or they fail * Cargo fmt * Fix typos in integration test comments --------- Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
* Resolve a bunch of upcoming clippy lintsBlaž Hrastnik2022-11-04
|
* Improve Readability (#2639)Ryan Russell2022-06-01
|
* Fix tests for surround primitivesGokul Soumya2022-04-29
|
* Support m in surround delete and replaceGokul Soumya2022-04-29
|
* Add `m` textobject to select closest surround pairGokul Soumya2022-04-29
|
* Show surround delete and replace errors in editor (#1709)Gokul Soumya2022-02-28
| | | | | * Refactor surround commands to use early returns * Show surround delete and replace errors in editor
* Fix Clippy lints in tests (#1563)Omnikar2022-01-23
| | | Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
* Fix surround cursor position calculation (#1183)Gokul Soumya2021-11-29
| | | | | | | | | | | | | | | Fixes #1077. This was caused by the assumption that a block cursor is represented as zero width internally and simply rendered to be a single width selection, where as in reality a block cursor is an actual single width selection in form and function. Behavioural changes: 1. Surround selection no longer works when cursor is _on_ a surround character that has matching pairs (like `'` or `"`). This was the intended behaviour from the start but worked till now because of the cursor position calculation mismatch.
* Fix buggy surround behavior from #376.Nathan Vegdahl2021-08-04
| | | | Fixes #543.
* Switch to a cleaner range-head moving abstraction.Nathan Vegdahl2021-07-24
| | | | Also fix a bunch of bugs related to it.
* Update surround commands to work with gap indexing.Nathan Vegdahl2021-07-08
|
* Fix typo on comment in surroundIvan Tham2021-07-03
|
* Fix surround bug when cursor on same pairGokul Soumya2021-07-03
| | | | | | For example when the cursor is _on_ the `'` in `'word'`, the cursor wouldn't move because the search for a matching pair started _from_ the position of the cursor and simply found itself.
* Skip enclosed pairs in surroundGokul Soumya2021-06-24
| | | | | | | | | Surround operations previously ignored other pairs that are enclosed within which should be skipped. For example if the cursor is on the `,` in `{{a},{b}}`, doing `md{` previously would delete the `{` on the left of `a` and `}` on the right of `b` instead of the outermost braces. This commit corrects this behavior.
* Correctly identify pairs when cursor on pairGokul Soumya2021-06-22
|
* Refactor and add tests for surroundGokul Soumya2021-06-22
|
* Add more surround pair charactersGokul Soumya2021-06-22
|
* Add surround keybindsGokul Soumya2021-06-22