forked from extern/nushell
Fix panic
This commit is contained in:
parent
f653992b4a
commit
0515ed976c
@ -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 New Issue
Block a user