mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
Merge pull request #1617 from tridactyl/fix_hint_vimperator_space
hinting.ts: Fix #1615
This commit is contained in:
commit
e04ec2c0c3
1 changed files with 10 additions and 2 deletions
|
@ -704,7 +704,7 @@ function popKey() {
|
|||
modeState.filterFunc(modeState.filter)
|
||||
}
|
||||
|
||||
/** If key is in hintchars, add it to filtstr and filter */
|
||||
/** Add key to filtstr and filter */
|
||||
function pushKey(key) {
|
||||
// The new key can be used to filter the hints
|
||||
const originalFilter = modeState.filter
|
||||
|
@ -718,6 +718,11 @@ function pushKey(key) {
|
|||
}
|
||||
}
|
||||
|
||||
/** Just run pushKey(" "). This is needed because ex commands ignore whitespace. */
|
||||
function pushSpace() {
|
||||
return pushKey(" ")
|
||||
}
|
||||
|
||||
/** Array of hintable elements in viewport
|
||||
|
||||
Elements are hintable if
|
||||
|
@ -867,7 +872,9 @@ export function parser(keys: KeyboardEvent[]) {
|
|||
// Add custom bindings on top of it
|
||||
Object.assign(keymap, config.get("hintmaps"))
|
||||
// If the key sequence matches, use this match
|
||||
const parsed = keyseq.parse(keys, keyseq.mapstrMapToKeyMap(new Map(Object.entries(keymap))))
|
||||
const parsed = keyseq.parse(keys,
|
||||
keyseq.mapstrMapToKeyMap(new Map((Object.entries(keymap) as any)
|
||||
.filter(([key, value]) => value != ""))))
|
||||
if (parsed.isMatch === true) {
|
||||
return parsed
|
||||
}
|
||||
|
@ -899,6 +906,7 @@ export function getHintCommands() {
|
|||
focusRightHint,
|
||||
selectFocusedHint,
|
||||
pushKey,
|
||||
pushSpace,
|
||||
popKey,
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue