mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 17:41:40 -05:00
Hack keyseq into working with ignore
This commit is contained in:
parent
c799c9a39d
commit
99f6dc4e8e
3 changed files with 22 additions and 12 deletions
|
@ -34,6 +34,11 @@ let USERCONFIG = o({})
|
|||
const DEFAULTS = o({
|
||||
configversion: "0.0",
|
||||
// When creating new <modifier-letter> maps, make sure to make the modifier uppercase (e.g. <C-a> instead of <c-a>) otherwise some commands might not be able to find them (e.g. `bind <c-a>`)
|
||||
imaps: o({
|
||||
"<S-Insert>": "mode normal",
|
||||
"<CA-Esc>": "mode normal",
|
||||
"<CA-`>": "mode normal",
|
||||
}),
|
||||
nmaps: o({
|
||||
"<F1>": "help",
|
||||
o: "fillcmdline open",
|
||||
|
|
|
@ -103,6 +103,7 @@ type KeyMap = Map<MinimalKey[], MapTarget>
|
|||
export type ParserResponse = {
|
||||
keys?: KeyEventLike[]
|
||||
value?: any
|
||||
exstr?: any
|
||||
isMatch: boolean
|
||||
}
|
||||
|
||||
|
@ -129,7 +130,7 @@ export function parse(keyseq: KeyEventLike[], map: KeyMap): ParserResponse {
|
|||
possibleMappings,
|
||||
([k, v]) => k.length === keyseq.length,
|
||||
)
|
||||
return { value: perfect[1], isMatch: true }
|
||||
return { value: perfect[1], exstr: perfect[1], isMatch: true }
|
||||
} catch (e) {
|
||||
if (!(e instanceof RangeError)) throw e
|
||||
}
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
import { hasModifiers } from "../keyseq"
|
||||
|
||||
import * as generic from "./genericmode"
|
||||
|
||||
// Placeholder - should be moved into generic parser
|
||||
export function parser(keys) {
|
||||
const response = { keys: [], exstr: undefined }
|
||||
if (
|
||||
(keys[0].shiftKey && keys[0].key === "Insert") ||
|
||||
(keys[0].altKey && keys[0].ctrlKey && keys[0].key === "Escape") ||
|
||||
(keys[0].altKey && keys[0].ctrlKey && keys[0].key === "`")
|
||||
) {
|
||||
return { keys: [], exstr: "mode normal" }
|
||||
}
|
||||
return { keys: [], exstr: undefined }
|
||||
}
|
||||
// export function parser(keys) {
|
||||
// const response = { keys: [], exstr: undefined }
|
||||
// if (
|
||||
// (keys[0].shiftKey && keys[0].key === "Insert") ||
|
||||
// (keys[0].altKey && keys[0].ctrlKey && keys[0].key === "Escape") ||
|
||||
// (keys[0].altKey && keys[0].ctrlKey && keys[0].key === "`")
|
||||
// ) {
|
||||
// return { keys: [], exstr: "mode normal" }
|
||||
// }
|
||||
// return { keys: [], exstr: undefined }
|
||||
// }
|
||||
|
||||
export let parser = keys => generic.parser("imaps",keys)
|
||||
|
|
Loading…
Add table
Reference in a new issue