helix/helix-view/src
Gabriel Hansson c1488267e5
(Updated) Apply motion API refinements (#6078)
* _apply_motion generalization where possible

API encourages users to not forget setting `editor.last_motion` when
applying a motion. But also not setting `last_motion` without applying a
motion first.

* (rename) will_find_char -> find_char

method name makes it sound like it would be returning a boolean.

* use _apply_motion in find_char

Feature that falls out from this is that repetitions of t,T,f,F are
saved with the context extention/move and count. (Not defaulting to extend
by 1 count).

* Finalize apply_motion API

last_motion is now a private field and can only be set by calling
Editor.apply_motion(). Removing need (and possibility) of writing:

`motion(editor); editor.last_motion = motion`

Now it's just: `editor.apply_motion(motion)`

* editor.last_message: rm Box wrap around Arc

* Use pre-existing `Direction` rather than custom `SearchDirection`.

* `LastMotion` type alias for `Option<Arc<dyn Fn(&mut Editor)>>`

* Take motion rather than cloning it.

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

* last_motion as Option<Motion>.

* Use `Box` over `Arc` for `last_motion`.

---------

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2023-07-09 16:50:24 -04:00
..
handlers Fix unwrap bug in DAP (#6786) 2023-04-17 15:36:04 -05:00
base64.rs Fix new clippy lints (#5892) 2023-02-09 16:27:08 -06:00
clipboard.rs Fix warnings from clippy (#7013) 2023-05-11 14:44:52 +09:00
document.rs correctly map unsorted positions (#7471) 2023-06-28 23:35:31 +09:00
editor.rs (Updated) Apply motion API refinements (#6078) 2023-07-09 16:50:24 -04:00
env.rs Use OSC 52 as a fallback for setting the system clipboard (#3220) 2022-11-02 10:12:40 +09:00
graphics.rs build(deps): bump bitflags from 1.3.2 to 2.0.2 (#6387) 2023-03-22 08:12:08 +08:00
gutter.rs Apply all review suggestions (doc_id -> id, error message, unnecessary if) 2023-05-18 22:04:49 +02:00
info.rs Place `Info::from_keymap()` contents in `keymap.infobox()`: 2023-06-07 10:11:13 +09:00
input.rs Fix new clippy lints (#5892) 2023-02-09 16:27:08 -06:00
keyboard.rs build(deps): bump bitflags from 1.3.2 to 2.0.2 (#6387) 2023-03-22 08:12:08 +08:00
lib.rs rework positioning/rendering and enable softwrap/virtual text (#5420) 2023-02-01 02:03:19 +09:00
macros.rs Apply transactions to all views (#4733) 2022-11-23 12:28:49 +09:00
theme.rs Allow ANSI colors in themes (#5119) 2023-06-19 11:02:34 +09:00
tree.rs Fix warnings from clippy (#7013) 2023-05-11 14:44:52 +09:00
view.rs fix view anchors not at start of a visual line 2023-03-27 09:54:40 +09:00