prompt and buffer drawing appears functional

This commit is contained in:
2025-05-27 02:41:19 -04:00
parent 45b7a16cae
commit 1e3715d353
9 changed files with 1114 additions and 1122 deletions

View File

@@ -4,7 +4,6 @@ use std::str::Chars;
use nix::NixPath;
use super::keys::{KeyEvent as E, KeyCode as K, ModKeys as M};
use super::linebuf::TermChar;
use super::vicmd::{Anchor, Bound, Dest, Direction, Motion, MotionBuilder, MotionCmd, RegisterName, TextObj, To, Verb, VerbBuilder, VerbCmd, ViCmd, Word};
use crate::prelude::*;
@@ -72,14 +71,8 @@ impl ViInsert {
impl ViMode for ViInsert {
fn handle_key(&mut self, key: E) -> Option<ViCmd> {
match key {
E(K::Grapheme(ch), M::NONE) => {
let ch = TermChar::from(ch);
self.pending_cmd.set_verb(VerbCmd(1,Verb::InsertChar(ch)));
self.pending_cmd.set_motion(MotionCmd(1,Motion::ForwardChar));
self.register_and_return()
}
E(K::Char(ch), M::NONE) => {
self.pending_cmd.set_verb(VerbCmd(1,Verb::InsertChar(TermChar::from(ch))));
self.pending_cmd.set_verb(VerbCmd(1,Verb::InsertChar(ch)));
self.pending_cmd.set_motion(MotionCmd(1,Motion::ForwardChar));
self.register_and_return()
}