mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Shell: Complete for current path when the text is empty
For example, when typing `cd <tab>`, the shell will show a list of files in the current directory. This behavior is similar to typing `cd ./<tab>`. It makes it easier to `cd` into directories without having to list them first.
This commit is contained in:
parent
9dbcda7eef
commit
31ca48ebb2
Notes:
sideshowbarker
2024-07-17 21:16:31 +09:00
Author: https://github.com/damienfir Commit: https://github.com/SerenityOS/serenity/commit/31ca48ebb2 Pull-request: https://github.com/SerenityOS/serenity/pull/13658
1 changed files with 1 additions and 1 deletions
|
@ -392,7 +392,7 @@ Vector<Line::CompletionSuggestion> Node::complete_for_editor(Shell& shell, size_
|
|||
}
|
||||
auto result = hit_test_position(offset);
|
||||
if (!result.matching_node)
|
||||
return {};
|
||||
return shell.complete_path("", "", 0, Shell::ExecutableOnly::No, result.closest_command_node.ptr(), nullptr, Shell::EscapeMode::Bareword);
|
||||
auto node = result.matching_node;
|
||||
if (node->is_bareword() || node != result.closest_node_with_semantic_meaning)
|
||||
node = result.closest_node_with_semantic_meaning;
|
||||
|
|
Loading…
Reference in a new issue