From c112f533578cda48396308ee34314917d97a5614 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Sun, 12 Apr 2020 22:40:23 +0430 Subject: [PATCH] Shell: Complete .hidden files if token starts with a dot --- Shell/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Shell/main.cpp b/Shell/main.cpp index 79628e0227..9cc44eb448 100644 --- a/Shell/main.cpp +++ b/Shell/main.cpp @@ -1100,9 +1100,15 @@ int main(int argc, char** argv) // `/foo/', but rather just `bar...' editor.suggest(token.length(), 0); - Core::DirIterator files(path, Core::DirIterator::SkipDots); + // only suggest dot-files if path starts with a dot + Core::DirIterator files(path, + token.starts_with('.') ? Core::DirIterator::NoFlags : Core::DirIterator::SkipDots); + while (files.has_next()) { auto file = files.next_path(); + // manually skip `.' and `..' + if (file == "." || file == "..") + continue; if (file.starts_with(token)) { suggestions.append(file); }