mirror of
https://github.com/Eugeny/tabby.git
synced 2025-01-30 14:20:18 +08:00
Make search options be remembered
This commit is contained in:
parent
afd6ce4346
commit
358d9f30d2
@ -26,7 +26,7 @@ button.btn.btn-link(
|
||||
.mr-2
|
||||
|
||||
button.btn.btn-link(
|
||||
(click)='options.caseSensitive = !options.caseSensitive',
|
||||
(click)='options.caseSensitive = !options.caseSensitive; saveSearchOptions()',
|
||||
[class.active]='options.caseSensitive',
|
||||
ngbTooltip='Case sensitivity',
|
||||
placement='bottom'
|
||||
@ -34,14 +34,14 @@ button.btn.btn-link(
|
||||
i.fa.fa-fw.fa-font
|
||||
|
||||
button.btn.btn-link(
|
||||
(click)='options.regex = !options.regex',
|
||||
(click)='options.regex = !options.regex; saveSearchOptions()',
|
||||
[class.active]='options.regex',
|
||||
ngbTooltip='Regular expression',
|
||||
placement='bottom'
|
||||
)
|
||||
i.fa.fa-fw.fa-asterisk
|
||||
button.btn.btn-link(
|
||||
(click)='options.wholeWord = !options.wholeWord',
|
||||
(click)='options.wholeWord = !options.wholeWord; saveSearchOptions()',
|
||||
[class.active]='options.wholeWord',
|
||||
ngbTooltip='Whole word',
|
||||
placement='bottom'
|
||||
|
@ -14,7 +14,7 @@ export class SearchPanelComponent {
|
||||
notFound = false
|
||||
options: SearchOptions = {
|
||||
incremental: true,
|
||||
regex: this.config.store.terminal.searchRegexAlwaysEnabled,
|
||||
...this.config.store.terminal.searchOptions
|
||||
}
|
||||
|
||||
@Output() close = new EventEmitter()
|
||||
@ -28,7 +28,7 @@ export class SearchPanelComponent {
|
||||
this.notFound = false
|
||||
this.findPrevious(true)
|
||||
}
|
||||
|
||||
|
||||
findNext (incremental = false): void {
|
||||
if (!this.query) {
|
||||
return
|
||||
@ -48,4 +48,12 @@ export class SearchPanelComponent {
|
||||
this.toastr.error('Not found')
|
||||
}
|
||||
}
|
||||
|
||||
saveSearchOptions (): void {
|
||||
this.config.store.terminal.searchOptions.regex = this.options.regex;
|
||||
this.config.store.terminal.searchOptions.caseSensitive = this.options.caseSensitive;
|
||||
this.config.store.terminal.searchOptions.wholeWord = this.options.wholeWord;
|
||||
|
||||
this.config.save();
|
||||
}
|
||||
}
|
||||
|
@ -66,6 +66,11 @@ export class TerminalConfigProvider extends ConfigProvider {
|
||||
warnOnMultilinePaste: true,
|
||||
showDefaultProfiles: true,
|
||||
searchRegexAlwaysEnabled: false,
|
||||
searchOptions: {
|
||||
regex: false,
|
||||
wholeWord: false,
|
||||
caseSensitive: false
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user