mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-24 21:40:06 +00:00
Merge pull request #3055 from matishadow/feature/regex-search-configuration
This commit is contained in:
commit
2bcf23cff1
@ -26,7 +26,7 @@ button.btn.btn-link(
|
|||||||
.mr-2
|
.mr-2
|
||||||
|
|
||||||
button.btn.btn-link(
|
button.btn.btn-link(
|
||||||
(click)='options.caseSensitive = !options.caseSensitive',
|
(click)='options.caseSensitive = !options.caseSensitive; saveSearchOptions()',
|
||||||
[class.active]='options.caseSensitive',
|
[class.active]='options.caseSensitive',
|
||||||
ngbTooltip='Case sensitivity',
|
ngbTooltip='Case sensitivity',
|
||||||
placement='bottom'
|
placement='bottom'
|
||||||
@ -34,14 +34,14 @@ button.btn.btn-link(
|
|||||||
i.fa.fa-fw.fa-font
|
i.fa.fa-fw.fa-font
|
||||||
|
|
||||||
button.btn.btn-link(
|
button.btn.btn-link(
|
||||||
(click)='options.regex = !options.regex',
|
(click)='options.regex = !options.regex; saveSearchOptions()',
|
||||||
[class.active]='options.regex',
|
[class.active]='options.regex',
|
||||||
ngbTooltip='Regular expression',
|
ngbTooltip='Regular expression',
|
||||||
placement='bottom'
|
placement='bottom'
|
||||||
)
|
)
|
||||||
i.fa.fa-fw.fa-asterisk
|
i.fa.fa-fw.fa-asterisk
|
||||||
button.btn.btn-link(
|
button.btn.btn-link(
|
||||||
(click)='options.wholeWord = !options.wholeWord',
|
(click)='options.wholeWord = !options.wholeWord; saveSearchOptions()',
|
||||||
[class.active]='options.wholeWord',
|
[class.active]='options.wholeWord',
|
||||||
ngbTooltip='Whole word',
|
ngbTooltip='Whole word',
|
||||||
placement='bottom'
|
placement='bottom'
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { Component, Input, Output, EventEmitter } from '@angular/core'
|
import { Component, Input, Output, EventEmitter } from '@angular/core'
|
||||||
import { ToastrService } from 'ngx-toastr'
|
import { ToastrService } from 'ngx-toastr'
|
||||||
import { Frontend, SearchOptions } from '../frontends/frontend'
|
import { Frontend, SearchOptions } from '../frontends/frontend'
|
||||||
|
import { ConfigService } from 'terminus-core'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'search-panel',
|
selector: 'search-panel',
|
||||||
@ -13,12 +14,14 @@ export class SearchPanelComponent {
|
|||||||
notFound = false
|
notFound = false
|
||||||
options: SearchOptions = {
|
options: SearchOptions = {
|
||||||
incremental: true,
|
incremental: true,
|
||||||
|
...this.config.store.terminal.searchOptions,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Output() close = new EventEmitter()
|
@Output() close = new EventEmitter()
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private toastr: ToastrService,
|
private toastr: ToastrService,
|
||||||
|
public config: ConfigService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
onQueryChange (): void {
|
onQueryChange (): void {
|
||||||
@ -45,4 +48,12 @@ export class SearchPanelComponent {
|
|||||||
this.toastr.error('Not found')
|
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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,7 +116,7 @@ h3.mb-3 Terminal
|
|||||||
[(ngModel)]='config.store.terminal.scrollOnInput',
|
[(ngModel)]='config.store.terminal.scrollOnInput',
|
||||||
(ngModelChange)='config.save()',
|
(ngModelChange)='config.save()',
|
||||||
)
|
)
|
||||||
|
|
||||||
.form-line
|
.form-line
|
||||||
.header
|
.header
|
||||||
.title Use Alt key as the Meta key
|
.title Use Alt key as the Meta key
|
||||||
|
@ -65,6 +65,12 @@ export class TerminalConfigProvider extends ConfigProvider {
|
|||||||
recoverTabs: true,
|
recoverTabs: true,
|
||||||
warnOnMultilinePaste: true,
|
warnOnMultilinePaste: true,
|
||||||
showDefaultProfiles: true,
|
showDefaultProfiles: true,
|
||||||
|
searchRegexAlwaysEnabled: false,
|
||||||
|
searchOptions: {
|
||||||
|
regex: false,
|
||||||
|
wholeWord: false,
|
||||||
|
caseSensitive: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user