nu-cli/completions: send original line to custom completer (#5459)

This commit is contained in:
Herlon Aguiar 2022-05-06 23:58:42 +02:00 committed by GitHub
parent 2dfd975940
commit b0647f780d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,6 +56,7 @@ impl NuCompleter {
fn completion_helper(&mut self, line: &str, pos: usize) -> Vec<Suggestion> {
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(