mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 18:35:09 +00:00
Shell: Complete .hidden files if token starts with a dot
This commit is contained in:
parent
364dbe28d6
commit
c112f53357
1 changed files with 7 additions and 1 deletions
|
@ -1100,9 +1100,15 @@ int main(int argc, char** argv)
|
||||||
// `/foo/', but rather just `bar...'
|
// `/foo/', but rather just `bar...'
|
||||||
editor.suggest(token.length(), 0);
|
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()) {
|
while (files.has_next()) {
|
||||||
auto file = files.next_path();
|
auto file = files.next_path();
|
||||||
|
// manually skip `.' and `..'
|
||||||
|
if (file == "." || file == "..")
|
||||||
|
continue;
|
||||||
if (file.starts_with(token)) {
|
if (file.starts_with(token)) {
|
||||||
suggestions.append(file);
|
suggestions.append(file);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue