mirror of
https://github.com/nushell/nushell
synced 2024-12-26 21:13:19 +00:00
Fix panic
This commit is contained in:
parent
f653992b4a
commit
0515ed976c
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ impl NuCompleter {
|
||||||
let mut completions;
|
let mut completions;
|
||||||
|
|
||||||
// See if we're a flag
|
// See if we're a flag
|
||||||
if pos > 0 && line_chars[replace_pos] == '-' {
|
if pos > 0 && replace_pos < line_chars.len() && line_chars[replace_pos] == '-' {
|
||||||
completions = self.get_matching_arguments(&line_chars, line, replace_pos, pos);
|
completions = self.get_matching_arguments(&line_chars, line, replace_pos, pos);
|
||||||
} else {
|
} else {
|
||||||
completions = self.file_completer.complete(line, pos, context)?.1;
|
completions = self.file_completer.complete(line, pos, context)?.1;
|
||||||
|
|
Loading…
Reference in a new issue