From 4b9bd1dc8c8f9a4289eba67b0643727f95fc812c Mon Sep 17 00:00:00 2001 From: Ryuichi Ueda Date: Sun, 22 Dec 2024 13:05:15 +0900 Subject: [PATCH] Fix alias expansion rule --- src/elements/command/simple/parser.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/elements/command/simple/parser.rs b/src/elements/command/simple/parser.rs index 4b093e12..45c587a8 100644 --- a/src/elements/command/simple/parser.rs +++ b/src/elements/command/simple/parser.rs @@ -36,8 +36,11 @@ impl SimpleCommand { ans.permit_substitution_arg = true; } } - if Self::set_alias(&w, &mut ans.words, &mut ans.text, core, feeder) { - return true; + + if ans.words.len() == 0 { + if Self::set_alias(&w, &mut ans.words, &mut ans.text, core, feeder) { + return true; + } } ans.text += &w.text;