Skip to content
This repository was archived by the owner on Apr 1, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions browser/src/Services/Configuration/DefaultConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const BaseConfiguration: IConfigurationValues = {
"editor.quickOpen.filterStrategy": "vscode",
"editor.quickOpen.defaultOpenMode": Oni.FileOpenMode.Edit,
"editor.quickOpen.alternativeOpenMode": Oni.FileOpenMode.ExistingTab,
"editor.quickOpen.showHidden": true,

"editor.split.mode": "native",

Expand Down
1 change: 1 addition & 0 deletions browser/src/Services/Configuration/IConfigurationValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export interface IConfigurationValues {
"editor.quickInfo.delay": number
"editor.quickOpen.defaultOpenMode": Oni.FileOpenMode
"editor.quickOpen.alternativeOpenMode": Oni.FileOpenMode
"editor.quickOpen.showHidden": boolean

"editor.errors.slideOnFocus": boolean
"editor.formatting.formatOnSwitchToNormalMode": boolean // TODO: Make this setting reliable. If formatting is slow, it will hose edits... not fun
Expand Down
7 changes: 4 additions & 3 deletions browser/src/Services/Search/RipGrep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ export function getCommand(): string {
return '"' + path.join(rootPath, executableName) + '"'
}

export function getArguments(excludePaths: string[]): string[] {
export function getArguments(excludePaths: string[], shouldShowHidden: boolean): string[] {
const ignoreArguments = excludePaths.reduce((prev, cur) => {
return prev.concat(["-g", "!" + cur])
}, [])

// TODO: Add option to enable "--hidden"
return ["--vimgrep"].concat(ignoreArguments)
const showHidden = shouldShowHidden ? ["--hidden"] : []

return ["--vimgrep"].concat(showHidden, ignoreArguments)
}
10 changes: 8 additions & 2 deletions browser/src/Services/Search/SearchProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ export class Search implements Oni.Search.ISearch {
const commandParts = [
RipGrep.getCommand(),
"--ignore-case",
...RipGrep.getArguments(configuration.getValue("oni.exclude")),
...RipGrep.getArguments(
configuration.getValue("oni.exclude"),
configuration.getValue("editor.quickOpen.showHidden"),
),
// "-e",
...(opts.fileFilter ? ["-g", opts.fileFilter] : []),
"--",
Expand All @@ -45,7 +48,10 @@ export class Search implements Oni.Search.ISearch {
public findInPath(opts: Oni.Search.Options): Oni.Search.Query {
const commandParts = [
RipGrep.getCommand(),
...RipGrep.getArguments(configuration.getValue("oni.exclude")),
...RipGrep.getArguments(
configuration.getValue("oni.exclude"),
configuration.getValue("editor.quickOpen.showHidden"),
),
"--files",
"--",
opts.workspace ? opts.workspace : ".",
Expand Down