1
0
mirror of https://github.com/Eugeny/tabby.git synced 2025-07-28 21:24:38 +00:00

allow searching for hotkey values -

This commit is contained in:
Eugene Pankov
2020-07-27 16:04:31 +02:00
parent 6d0b2608a2
commit efe390f68d
2 changed files with 7 additions and 1 deletions

@@ -288,7 +288,7 @@ ngb-tabset.vertical(type='pills', [activeId]='activeTab')
th ID
th Hotkey
ng-container(*ngFor='let hotkey of hotkeyDescriptions')
tr(*ngIf='!hotkeyFilter || hotkey.name.toLowerCase().includes(hotkeyFilter.toLowerCase())')
tr(*ngIf='!hotkeyFilter || hotkeyFilterFn(hotkey, hotkeyFilter)')
td {{hotkey.name}}
td {{hotkey.id}}
td.pr-5

@@ -144,4 +144,10 @@ export class SettingsTabComponent extends BaseTabComponent {
}
ptr[prop] = value
}
hotkeyFilterFn (hotkey: HotkeyDescription, query: string): boolean {
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
const s = hotkey.name + (this.getHotkey(hotkey.id) || []).toString() as string
return s.toLowerCase().includes(query.toLowerCase())
}
}