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
This commit is contained in:
Gokul Soumya 2021-07-03 06:37:49 +05:30 committed by GitHub
parent c5b2973739
commit c68fe1f2a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 475 additions and 7 deletions

View file

@ -18,6 +18,7 @@ pub mod selection;
mod state;
pub mod surround;
pub mod syntax;
pub mod textobject;
mod transaction;
pub mod unicode {