Skip to content
Myr

Lint

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 dea60b1 · Browse files · 7 files+14 added−12 removed
This commit

State

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

Diff stats

7 files+14 added−12 removed

  • other:+14 added−12 removed

7 files+14 added−12 removed

modified:src/constants.go+1 added-1 removed
6 unmodified lines
7)89const (10 // Current version11 Version = "0.10.1"11 version = "0.10.1"1213 // Core14 coordinatorDelayMax time.Duration = 100 * time.Millisecond15 coordinatorDelayStep time.Duration = 10 * time.Millisecond
34 unmodified lines
modified:src/core.go+1 added-1 removed
53 unmodified lines
54 sort := opts.Sort > 055 rankTiebreak = opts.Tiebreak5657 if opts.Version {58 fmt.Println(Version)58 fmt.Println(version)59 os.Exit(0)60 }6162 // Event channel
205 unmodified lines
modified:src/history.go+2 added
5 unmodified lines
6 "os"7 "strings"8)910// History struct represents input history11type History struct {12 path string13 lines []string14 modified map[int]string15 maxSize int16 cursor int17}1819// NewHistory returns the pointer to a new History struct20func NewHistory(path string, maxSize int) (*History, error) {21 fmtError := func(e error) error {22 if os.IsPermission(e) {23 return errors.New("permission denied: " + path)
73 unmodified lines
modified:src/matcher.go+1 added-1 removed
94 unmodified lines
95 merger, cancelled = m.scan(request)96 }9798 if !cancelled {99 if merger.Cacheable() {99 if merger.cacheable() {100 m.mergerCache[patternString] = merger101 }102 merger.final = request.final103 m.eventBox.Set(EvtSearchFin, merger)
118 unmodified lines
modified:src/merger.go+1 added-1 removed
80 unmodified lines
81 }82 panic(fmt.Sprintf("Index out of bounds (unsorted, %d/%d)", idx, mg.count))83}8485func (mg *Merger) Cacheable() bool {85func (mg *Merger) cacheable() bool {86 return mg.count < mergerCacheMax87}8889func (mg *Merger) mergedGet(idx int) *Item {
29 unmodified lines
modified:src/options.go+1 added-1 removed
511 unmodified lines
512 keymap[key] = actClearScreen513 case "delete-char":514 keymap[key] = actDeleteChar515 case "delete-char/eof":516 keymap[key] = actDeleteCharEof516 keymap[key] = actDeleteCharEOF517 case "end-of-line":518 keymap[key] = actEndOfLine519 case "cancel":520 keymap[key] = actCancel
377 unmodified lines
modified:src/terminal.go+7 added-7 removed
104 unmodified lines
105 actBackwardWord106 actCancel107 actClearScreen108 actDeleteChar109 actDeleteCharEof109 actDeleteCharEOF110 actEndOfLine111 actForwardChar112 actForwardWord113 actKillLine
26 unmodified lines
140 keymap[C.CtrlC] = actAbort141 keymap[C.CtrlG] = actAbort142 keymap[C.CtrlQ] = actAbort143 keymap[C.ESC] = actAbort144 keymap[C.CtrlD] = actDeleteCharEof144 keymap[C.CtrlD] = actDeleteCharEOF145 keymap[C.CtrlE] = actEndOfLine146 keymap[C.CtrlF] = actForwardChar147 keymap[C.CtrlH] = actBackwardDeleteChar148 keymap[C.BSpace] = actBackwardDeleteChar
286 unmodified lines
435 idx = len(t.header) - idx - 1436 }437 line := idx + 2438 if t.inlineInfo {439 line -= 1439 line--440 }441 if line >= max {442 continue443 }
17 unmodified lines
461 count := t.merger.Length() - t.offset462 for i := 0; i < maxy; i++ {463 line := i + 2 + len(t.header)464 if t.inlineInfo {465 line -= 1465 line--466 }467 t.move(line, 0, true)468 if i < count {469 t.printItem(t.merger.Get(i+t.offset), i == t.cy-t.offset)
391 unmodified lines
861 case actAbort:862 req(reqQuit)863 case actDeleteChar:864 t.delChar()865 case actDeleteCharEof:865 case actDeleteCharEOF:866 if !t.delChar() && t.cx == 0 {867 req(reqQuit)868 }869 case actEndOfLine:
142 unmodified lines
1012 my = t.maxHeight() - my - 11013 }1014 min := 2 + len(t.header)1015 if t.inlineInfo {1016 min -= 11016 min--1017 }1018 if me.Double {1019 // Double-click1020 if my >= min {
77 unmodified lines
10981099func (t *Terminal) maxItems() int {1100 max := t.maxHeight() - 2 - len(t.header)1101 if t.inlineInfo {1102 max += 11102 max++1103 }1104 return util.Max(max, 0)1105}