implemented proper cursor placement for line editor

This commit is contained in:
2025-05-27 03:32:08 -04:00
parent 1e3715d353
commit 0e95e006d8
4 changed files with 84 additions and 19 deletions

View File

@@ -530,6 +530,14 @@ impl ViMode for ViNormal {
flog!(DEBUG, key);
match key {
E(K::Char(ch), M::NONE) => self.try_parse(ch),
E(K::Backspace, M::NONE) => {
Some(ViCmd {
register: Default::default(),
verb: None,
motion: Some(MotionCmd(1, Motion::BackwardChar)),
raw_seq: "".into(),
})
}
E(K::Char('R'), M::CTRL) => {
let mut chars = self.pending_seq.chars().peekable();
let count = self.parse_count(&mut chars).unwrap_or(1);