From 1eb5306fe6e0e09970b37d267051589d8133a824 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sat, 11 Apr 2026 18:29:57 +0800 Subject: Implement basic command completion with shell support --- mingling_core/src/asset/comp/shell_ctx.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'mingling_core/src/asset/comp') diff --git a/mingling_core/src/asset/comp/shell_ctx.rs b/mingling_core/src/asset/comp/shell_ctx.rs index 4771e63..5ab0514 100644 --- a/mingling_core/src/asset/comp/shell_ctx.rs +++ b/mingling_core/src/asset/comp/shell_ctx.rs @@ -74,22 +74,17 @@ impl TryFrom> for ShellContext { .map(ShellFlag::from) .unwrap_or(ShellFlag::Other("unknown".to_string())); - // Build all_words from command_line using basic whitespace splitting - // Note: External input replaces '-' with '^' in arguments, so we need to restore them let all_words = command_line .split_whitespace() .map(|s| s.replace('^', "-")) .collect(); - // Also restore the original command_line with proper hyphens - let command_line = command_line.replace('^', "-"); - Ok(ShellContext { - command_line, + command_line: command_line.replace('^', "-"), cursor_position, - current_word, - previous_word, - command_name, + current_word: current_word.replace('^', "-"), + previous_word: previous_word.replace('^', "-"), + command_name: command_name.replace('^', "-"), word_index, all_words, shell_flag, -- cgit