fix: Only try expanding directory completion if it makes sense

Fixes #487
This commit is contained in:
Blaž Hrastnik 2021-07-23 18:10:30 +09:00
parent 58d08d36ae
commit 817a7e0bd6

View file

@ -463,7 +463,7 @@ impl Component for Prompt {
code: KeyCode::Enter, code: KeyCode::Enter,
.. ..
} => { } => {
if self.line.ends_with('/') { if self.selection.is_some() && self.line.ends_with('/') {
self.completion = (self.completion_fn)(&self.line); self.completion = (self.completion_fn)(&self.line);
self.exit_selection(); self.exit_selection();
} else { } else {