Skip to content

Commit

Permalink
Create key event expr with non-zero count (#1846)
Browse files Browse the repository at this point in the history
  • Loading branch information
zenyusy authored Nov 10, 2024
1 parent 0b5749f commit 4fefcf7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -1347,12 +1347,13 @@ func (ui *ui) readNormalEvent(ev tcell.Event, nav *nav) expr {
}
expr := gOpts.keys[string(ui.keyAcc)]

if e, ok := expr.(*callExpr); ok && count != 0 {
expr = &callExpr{e.name, e.args, e.count}
expr.(*callExpr).count = count
} else if e, ok := expr.(*listExpr); ok && count != 0 {
expr = &listExpr{e.exprs, e.count}
expr.(*listExpr).count = count
if count != 0 {
switch e := expr.(type) {
case *callExpr:
expr = &callExpr{name: e.name, args: e.args, count: count}
case *listExpr:
expr = &listExpr{exprs: e.exprs, count: count}
}
}

ui.keyAcc = nil
Expand Down

0 comments on commit 4fefcf7

Please sign in to comment.