Skip to content

Commit

Permalink
VisualMode: treat 2+0 as number prefix
Browse files Browse the repository at this point in the history
for #1065
  • Loading branch information
gdh1995 committed Jan 1, 2024
1 parent fbfb465 commit 1ba7062
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions content/visual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,10 @@ const ensureLine = (command1: number, s0: string): void => {
return esc!(HandlerResult.Prevent)
}
const childAction = keyMap[currentPrefix + key],
newActions = (<RegExpOne> /^v\d/).test(key) ? +key.slice(1) : childAction || keyMap[key]
if (!(newActions as VisualAction >= 0)) {
// asserts newActions is VisualAction.NextKey | NaN undefined
newActions = (<RegExpOne> /^v\d/).test(key) ? +key.slice(1) : key === "0" && currentKeys ? void 0
: childAction || keyMap[key]
if (!(newActions! >= 0)) {
// asserts newActions is VisualAction.NextKey | undefined (NaN)
currentPrefix = newActions! < 0 ? key : ""
return keybody < kChar.minNotF_num && keybody > kChar.maxNotF_num ? HandlerResult.Nothing
: newActions ? HandlerResult.Prevent
Expand Down

0 comments on commit 1ba7062

Please sign in to comment.