Commit Graph

45 Commits (dd2903ff10387c04e933aa37846663131297b8b3)

Author SHA1 Message Date
Gokul Soumya c68fe1f2a3
Add object selection (textobjects) (#385)
* 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
3 years ago
Nathan Vegdahl 220bc85821 Fix all remaining warnings in helix-core except for two.
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.
3 years ago
Nathan Vegdahl b571f28641 Remove #[allow(unused)] from helix-core, and fix unused imports.
Still a bunch more warnings to fix in core, but it's a start.
3 years ago
Blaž Hrastnik 3007478567 fix: Correctly merge multiple selection ranges together
Fixes #391
3 years ago
Blaž Hrastnik 9c53461429 fix: Select matching at the start of the doc could crash. Fixes #346 3 years ago
PabloMansanet 86af55c379
Movement fixes, refactor and unit test suite (#217)
* 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
3 years ago
Kirawi c17dcb8633
Fixing Multiple Panics (#121)
* init

* wip

* wip
3 years ago
Blaž Hrastnik 6c705f09e8 Lint 3 years ago
Blaž Hrastnik 95dd55ba94 Fix overlap calculation. 3 years ago
Blaž Hrastnik 73f4abbb37 N as extend with search (for now, N should be search_prev). 3 years ago
Blaž Hrastnik 35b4fe4cd0 Fix range.overlap() 3 years ago
Blaž Hrastnik 742b3a709f Store intra-files jumps (goto) on the jumplist. 3 years ago
Blaž Hrastnik 06aca7691c clippy lint 3 years ago
Blaž Hrastnik bd607b4cbd Provide a capacity on Selection::new's normalize. 3 years ago
Blaž Hrastnik c4792efead clippy lints 3 years ago
Blaž Hrastnik 798dbd27c5 Selection: fail early if new() is called with no ranges. 3 years ago
Blaž Hrastnik 71999cce43 Implement auto-pairs behavior for open and close. 3 years ago
Blaž Hrastnik f29f01858d Implement iter() and len() directly on Selection. 3 years ago
Blaž Hrastnik dd91090a1a Implement keep_selections (filter selections on regex). 3 years ago
Blaž Hrastnik 1cf887dea9 Cleanup: use doc.selection() instead of doc.state.selection(). 3 years ago
Blaž Hrastnik 33c67f1388 commands: add * as selection search. 3 years ago
Blaž Hrastnik c9dd1c930e treewide: &RopeSlice -> RopeSlice. It's Copy so no reason to pass by ref 3 years ago
Blaž Hrastnik 9cac44c7c0 minor changes 3 years ago
Blaž Hrastnik 239db79834 Finally: Retain horizontal position when moving vertically. 3 years ago
Blaž Hrastnik a924ad2885 simplify. 3 years ago
Blaž Hrastnik 2bea5db7bd commands: Implement select_on_matches. 3 years ago
Blaž Hrastnik f5981f72c2 Introduce Selection::point. 4 years ago
Blaž Hrastnik 94f9603c74 Fix compose not merging certain changesets correctly. 4 years ago
Blaž Hrastnik 00e661f600 Indent draft, linewise paste 4 years ago
Blaž Hrastnik 1dba0f2b1c Simple yank/paste registers. 4 years ago
Blaž Hrastnik 8c7bc71ede Split on matches off by one, breaks tests again. 4 years ago
Blaž Hrastnik 592c5b0af2 Fix test, break split + append 4 years ago
Blaž Hrastnik 36e7e2133f Split selection on regex, fix InputEdit generation. 4 years ago
Blaž Hrastnik 3020077da8 Extend selection commands. 4 years ago
Blaž Hrastnik 96db02742e Simplify some more code. 4 years ago
Blaž Hrastnik 22cb7b3338 Change -> Operation, Change2 -> Change 4 years ago
Blaž Hrastnik f098166571 Get rid of a bunch of clones. 4 years ago
Blaž Hrastnik dd749bb284 Expand transaction API. 4 years ago
Blaž Hrastnik 579b6899f1 Work on insert mode. 4 years ago
Blaž Hrastnik f8fe273a2e Fix build. 4 years ago
Blaž Hrastnik 613d06dfb0 wip: importing to github 4 years ago
Blaž Hrastnik 1984410ac9 Selection mapping over changesets. 4 years ago
Blaž Hrastnik b5c38812e9 address clippy warnings 4 years ago
Blaž Hrastnik 23109f1512 OT: changeset: Implement compose and apply. 4 years ago
Blaž Hrastnik 44ff4d3c1f Implement a new core based on CodeMirror. 4 years ago