Skip to content

Commit

Permalink
fix: remove file completions for ls
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Jan 14, 2023
1 parent 75b555b commit 8582996
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/utils/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,16 +283,15 @@ async function getCompletions(input: string, cwd: string) {
)
}
// Files
const directoryCommands = ['cd', 'ls']
const frequentlyUsedFileCommands = ['cat', 'cp', 'diff', 'more', 'mv', 'rm', 'source', 'vi']
.concat(directoryCommands)
const frequentlyUsedFileCommands = ['cat', 'cd', 'cp', 'diff', 'more', 'mv', 'rm', 'source', 'vi']
if (!isInputingArgs && (
frequentlyUsedFileCommands.includes(command) || (
process.platform === 'win32'
? /^\.{1,2}\\/.test(currentWord)
: /^(~|\.{1,2})?\//.test(currentWord)
)
)) {
const directoryCommands = ['cd', 'dir', 'ls']
const directoryOnly = directoryCommands.includes(command)
asyncCompletionLists.push(
getFileCompletions(currentWord, cwd, directoryOnly),
Expand Down

0 comments on commit 8582996

Please sign in to comment.