Skip to content
Myr

Minor refactoring

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 8f99f8f · Browse files · 1 file+6 added−3 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+6 added−3 removed

  • other:+6 added−3 removed

1 file+6 added−3 removed

modified:src/options.go+6 added-3 removed
293 unmodified lines
294}295296func parseKeymap(keymap map[int]actionType, toggleSort bool, str string) (map[int]actionType, bool) {297 for _, pairStr := range strings.Split(str, ",") {298 fail := func() {299 errorExit("invalid key binding: " + pairStr)300 }301 pair := strings.Split(pairStr, ":")302 if len(pair) != 2 {300 errorExit("invalid key binding: " + pairStr)303 fail()304 }305 keys := parseKeyChords(pair[0], "key name required")306 if len(keys) != 1 {304 errorExit("invalid key binding: " + pairStr)307 fail()308 }309 key := keys[0]310 act := strings.ToLower(pair[1])308 switch strings.ToLower(pair[1]) {311 switch act {312 case "beginning-of-line":313 keymap[key] = actBeginningOfLine314 case "abort":315 keymap[key] = actAbort
217 unmodified lines