From 809a7e5f71e045c3373e0b855e7ff28c058ba09d Mon Sep 17 00:00:00 2001 From: Justine Pelletreau Date: Tue, 21 Feb 2023 17:26:04 +0100 Subject: [PATCH] Fixed the situation where using an alias inside a hotkey --- src/lib.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 70fe03e..6a81e03 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -532,15 +532,16 @@ pub mod shell { let hotcmd = &conf.hotkeys[&x].clone(); for c in hotcmd.chars() { if c != '\n' { - write_letter(&mut mycommand, - &mut current_pos, - &mut max_pos, + write_letter(&mut mycommand, + &mut current_pos, + &mut max_pos, c); } else { current_pos = 0; max_pos = 0; + mycommand = transform_alias(&conf, mycommand); run_cmd(&mut mycommand, - &mut current_number, + &mut current_number, &mut conf, &mut stdout); } @@ -552,8 +553,9 @@ pub mod shell { append_prev_arg(&mut mycommand, &mut current_pos, &mut max_pos); }, '!' => { - let mut cmd = format!("echo -- ALIASES --> {:?}", conf.hotkeys); - run_cmd(&mut cmd, &mut current_number, &mut conf, &mut stdout); + let mut cmd = format!("\r\n-- ALIASES --> \r\n{:?}\r\n", conf.hotkeys); + cmd = cmd.replace(",", "\r\n"); + write!(stdout, "{}", cmd); }, _ => (),