mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 19:03:30 +04:00
Allow tab-completion to continue when there is only a single, unambigous completion target which is a directory. This allows e.g. nested directories to be quickly drilled down just by hitting <tab> instead of first selecting the completion then hitting <enter>.
This commit is contained in:
parent
f85f0b7272
commit
567ddef388
@ -526,6 +526,11 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
|
||||
}
|
||||
key!(Tab) => {
|
||||
self.change_completion_selection(CompletionDirection::Forward);
|
||||
// if single completion candidate is a directory list content in completion
|
||||
if self.completion.len() == 1 && self.line.ends_with(std::path::MAIN_SEPARATOR) {
|
||||
self.recalculate_completion(cx.editor);
|
||||
self.exit_selection();
|
||||
}
|
||||
(self.callback_fn)(cx, &self.line, PromptEvent::Update)
|
||||
}
|
||||
shift!(Tab) => {
|
||||
|
Loading…
Reference in New Issue
Block a user