mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
This patch implements Vim motions. The VimMotion class will accept keycodes from the editing engine to build up a motion, and will signal when a motion is complete via VimMotion::is_complete(). The editing engine can then call VimMotion::get_range() to obtain a TextRange object which can be used to perform operations on the text, or VimMotion::get_position() to obtain a TextPosition which is the new position of the cursor after the motion. Currently, the following motions are supported: - h/j/k/l, regular Vim line and character movements - 0/^/$, start/end of line and start of non-blank - w/e/b/ge, word-related movements - W/E/B/gE, WORD (anything non-blank) versions of the above motions - gg/G, document related movements - t/f, to/find character All motions except gg/G accept a number prefix to repeat the motion that many times. This patch updates insert, normal and visual modes to use this motion system for movement.
38 KiB
38 KiB