mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
Shell: Complete .hidden files if token starts with a dot
This commit is contained in:
parent
364dbe28d6
commit
c112f53357
Notes:
sideshowbarker
2024-07-19 07:39:30 +09:00
Author: https://github.com/alimpfard
Commit: c112f53357
Pull-request: https://github.com/SerenityOS/serenity/pull/1767
Issue: https://github.com/SerenityOS/serenity/issues/1535
Issue: https://github.com/SerenityOS/serenity/issues/1762
1 changed files with 7 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue