Skip to content
Myr

Show more specific error message on invalid binding

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent a0e6147 · Browse files · 1 file+2 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−8 removed

  • other:+2 added−8 removed

1 file+2 added−8 removed

modified:src/options.go+2 added-8 removed
451 unmodified lines
452 for _, pairStr := range strings.Split(masked, ",") {453 origPairStr := str[idx : idx+len(pairStr)]454 idx += len(pairStr) + 1455456 fail := func() {457 errorExit("invalid key binding: " + pairStr)458 }456 pair := strings.SplitN(pairStr, ":", 2)460 if len(pair) != 2 {461 fail()457 if len(pair) < 2 {458 errorExit("bind action not specified: " + origPairStr)459 }460 var key int461 if len(pair[0]) == 1 && pair[0][0] == escapedColon {462 key = ':' + curses.AltZ463 } else if len(pair[0]) == 1 && pair[0][0] == escapedComma {464 key = ',' + curses.AltZ465 } else {466 keys := parseKeyChords(pair[0], "key name required")470 if len(keys) != 1 {471 fail()472 }467 key = firstKey(keys)468 }469470 act := origPairStr[len(pair[0])+1 : len(origPairStr)]
320 unmodified lines