1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:27:34 +00:00

Shell: Auto-completion shouldn't suggest non-executable files for the program name

This commit is contained in:
Gunnar Beutner 2021-04-20 16:17:38 +02:00 committed by Andreas Kling
parent e45e0eeb47
commit 111ac4b1f4
3 changed files with 13 additions and 7 deletions

View file

@ -178,9 +178,14 @@ public:
static bool is_glob(const StringView&);
static Vector<StringView> split_path(const StringView&);
enum class ExecutableOnly {
Yes,
No
};
void highlight(Line::Editor&) const;
Vector<Line::CompletionSuggestion> complete();
Vector<Line::CompletionSuggestion> complete_path(const String& base, const String&, size_t offset);
Vector<Line::CompletionSuggestion> complete_path(const String& base, const String&, size_t offset, ExecutableOnly executable_only);
Vector<Line::CompletionSuggestion> complete_program_name(const String&, size_t offset);
Vector<Line::CompletionSuggestion> complete_variable(const String&, size_t offset);
Vector<Line::CompletionSuggestion> complete_user(const String&, size_t offset);