reimplemented ex-mode widget/function execution

This commit is contained in:
2026-03-20 12:36:57 -04:00
parent 392506d414
commit 6f44759deb
8 changed files with 139 additions and 89 deletions

View File

@@ -42,11 +42,10 @@ struct ExEditor {
impl ExEditor {
pub fn new(history: History) -> Self {
let mut new = Self {
Self {
history,
..Default::default()
};
new
}
}
pub fn clear(&mut self) {
*self = Self::default()
@@ -169,7 +168,7 @@ impl ViMode for ViEx {
}
fn pending_cursor(&self) -> Option<usize> {
Some(self.pending_cmd.buf.cursor.get())
Some(self.pending_cmd.buf.cursor_to_flat())
}
fn move_cursor_on_undo(&self) -> bool {
@@ -229,9 +228,6 @@ fn parse_ex_cmd(raw: &str) -> Result<Option<ViCmd>, Option<String>> {
/// Unescape shell command arguments
fn unescape_shell_cmd(cmd: &str) -> String {
// The pest grammar uses double quotes for vicut commands
// So shell commands need to escape double quotes
// We will be removing a single layer of escaping from double quotes
let mut result = String::new();
let mut chars = cmd.chars().peekable();
while let Some(ch) = chars.next() {