From f9a46ce1e7980f425b1a0a98c0de649d4317ba40 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Sun, 8 Dec 2019 19:04:23 +1300 Subject: [PATCH] WIP param completions --- src/shell/completer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shell/completer.rs b/src/shell/completer.rs index ca038f7236..dffb337df9 100644 --- a/src/shell/completer.rs +++ b/src/shell/completer.rs @@ -32,7 +32,7 @@ impl NuCompleter { // See if we're a flag let mut completions = vec![]; - if pos > 0 && line_chars[pos - 1] == '-' { + if pos > 0 && line_chars[replace_pos] == '-' { let mut line_copy = line.to_string(); let replace_string = (replace_pos..pos).map(|_| " ").collect::(); line_copy.replace_range(replace_pos..pos, &replace_string);