From 31ca48ebb29e3cfe6937e575cadfba96b9c3fd09 Mon Sep 17 00:00:00 2001 From: Damien Firmenich Date: Wed, 13 Apr 2022 15:25:55 +0200 Subject: Shell: Complete for current path when the text is empty For example, when typing `cd `, the shell will show a list of files in the current directory. This behavior is similar to typing `cd ./`. It makes it easier to `cd` into directories without having to list them first. --- Userland/Shell/AST.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Shell/AST.cpp') diff --git a/Userland/Shell/AST.cpp b/Userland/Shell/AST.cpp index 224b7a0973..205a79f1c3 100644 --- a/Userland/Shell/AST.cpp +++ b/Userland/Shell/AST.cpp @@ -392,7 +392,7 @@ Vector 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; -- cgit v1.2.3