Add possibility to configure always enabled regex

This commit is contained in:
matishadow 2020-10-08 19:30:57 +02:00
parent c9d75d81e4
commit 444d92d393
3 changed files with 12 additions and 0 deletions

View File

@ -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,
regex: this.config.store.terminal.searchRegexAlwaysEnabled,
} }
@Output() close = new EventEmitter() @Output() close = new EventEmitter()
constructor ( constructor (
private toastr: ToastrService, private toastr: ToastrService,
public config: ConfigService,
) { } ) { }
onQueryChange (): void { onQueryChange (): void {

View File

@ -116,6 +116,14 @@ h3.mb-3 Terminal
[(ngModel)]='config.store.terminal.scrollOnInput', [(ngModel)]='config.store.terminal.scrollOnInput',
(ngModelChange)='config.save()', (ngModelChange)='config.save()',
) )
.form-line
.header
.title Regex in search always enabled
toggle(
[(ngModel)]='config.store.terminal.searchRegexAlwaysEnabled',
(ngModelChange)='config.save()',
)
.form-line .form-line
.header .header

View File

@ -65,6 +65,7 @@ export class TerminalConfigProvider extends ConfigProvider {
recoverTabs: true, recoverTabs: true,
warnOnMultilinePaste: true, warnOnMultilinePaste: true,
showDefaultProfiles: true, showDefaultProfiles: true,
searchRegexAlwaysEnabled: false,
}, },
} }