diff --git a/terminus-terminal/src/components/searchPanel.component.pug b/terminus-terminal/src/components/searchPanel.component.pug index d8077ab7..f886a186 100644 --- a/terminus-terminal/src/components/searchPanel.component.pug +++ b/terminus-terminal/src/components/searchPanel.component.pug @@ -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' diff --git a/terminus-terminal/src/components/searchPanel.component.ts b/terminus-terminal/src/components/searchPanel.component.ts index 2e9a8dae..25bbdbb6 100644 --- a/terminus-terminal/src/components/searchPanel.component.ts +++ b/terminus-terminal/src/components/searchPanel.component.ts @@ -1,6 +1,7 @@ import { Component, Input, Output, EventEmitter } from '@angular/core' import { ToastrService } from 'ngx-toastr' import { Frontend, SearchOptions } from '../frontends/frontend' +import { ConfigService } from 'terminus-core' @Component({ selector: 'search-panel', @@ -13,12 +14,14 @@ export class SearchPanelComponent { notFound = false options: SearchOptions = { incremental: true, + ...this.config.store.terminal.searchOptions, } @Output() close = new EventEmitter() constructor ( private toastr: ToastrService, + public config: ConfigService, ) { } onQueryChange (): void { @@ -45,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() + } } diff --git a/terminus-terminal/src/components/terminalSettingsTab.component.pug b/terminus-terminal/src/components/terminalSettingsTab.component.pug index 481f1121..3314af10 100644 --- a/terminus-terminal/src/components/terminalSettingsTab.component.pug +++ b/terminus-terminal/src/components/terminalSettingsTab.component.pug @@ -116,7 +116,7 @@ h3.mb-3 Terminal [(ngModel)]='config.store.terminal.scrollOnInput', (ngModelChange)='config.save()', ) - + .form-line .header .title Use Alt key as the Meta key diff --git a/terminus-terminal/src/config.ts b/terminus-terminal/src/config.ts index 9511981d..fc05958e 100644 --- a/terminus-terminal/src/config.ts +++ b/terminus-terminal/src/config.ts @@ -65,6 +65,12 @@ export class TerminalConfigProvider extends ConfigProvider { recoverTabs: true, warnOnMultilinePaste: true, showDefaultProfiles: true, + searchRegexAlwaysEnabled: false, + searchOptions: { + regex: false, + wholeWord: false, + caseSensitive: false, + }, }, }