From b0647f780d491547f9a1cf09c151843e5c5bfb0f Mon Sep 17 00:00:00 2001 From: Herlon Aguiar Date: Fri, 6 May 2022 23:58:42 +0200 Subject: [PATCH] nu-cli/completions: send original line to custom completer (#5459) --- crates/nu-cli/src/completions/completer.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/nu-cli/src/completions/completer.rs b/crates/nu-cli/src/completions/completer.rs index e01648158e..ed1adc4c1d 100644 --- a/crates/nu-cli/src/completions/completer.rs +++ b/crates/nu-cli/src/completions/completer.rs @@ -56,6 +56,7 @@ impl NuCompleter { fn completion_helper(&mut self, line: &str, pos: usize) -> Vec { let mut working_set = StateWorkingSet::new(&self.engine_state); let offset = working_set.next_span_start(); + let initial_line = line.to_string(); let mut line = line.to_string(); line.insert(pos, 'a'); let pos = offset + pos; @@ -150,7 +151,7 @@ impl NuCompleter { self.engine_state.clone(), self.stack.clone(), *decl_id, - line, + initial_line, ); return self.process_completion(