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`.
* 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
* 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
* 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