Merge pull request #2234 from saulrh/parser_keys_on_exstr

Return keys=[] from parser so things don't blow up if exstr is ""
This commit is contained in:
Oliver Blanthorn 2020-03-20 10:33:51 +00:00 committed by GitHub
commit ead0d0b914
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -3452,7 +3452,7 @@ export async function unbind(...args: string[]) {
export async function unbindurl(pattern: string, mode: string, keys: string) {
const args_obj = parse_bind_args(mode, keys)
return config.setURL(pattern, args_obj.configName, args_obj.key, "")
return config.setURL(pattern, args_obj.configName, args_obj.key, null)
}
/**

View file

@ -169,6 +169,7 @@ export function parse(keyseq: KeyEventLike[], map: KeyMap): ParserResponse {
exstr: perfect[1] + numericPrefixToExstrSuffix(numericPrefix),
isMatch: true,
numericPrefix: numericPrefix.length ? Number(numericPrefix.map(ke => ke.key).join("")) : undefined,
keys: [],
}
} catch (e) {
if (!(e instanceof RangeError)) throw e