Skip to content
Myr

Add visual indication of --toggle-sort

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

Close #194

authored by Junegunn Choi · committed by Junegunn Choi · parent d08542c · Browse files · 3 files+15 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

3 files+15 added−3 removed

  • other:+15 added−3 removed

3 files+15 added−3 removed

modified:src/core.go+3 added-2 removed
193 unmodified lines
194 terminal.UpdateCount(count, !reading)195 matcher.Reset(snapshot, terminal.Input(), false, !reading, sort)196197 case EvtSearchNew:198 if value.(bool) {199 sort = !sort198 switch val := value.(type) {199 case bool:200 sort = val201 }202 snapshot, _ := chunkList.Snapshot()203 matcher.Reset(snapshot, terminal.Input(), true, !reading, sort)204 delay = false
45 unmodified lines
modified:src/terminal.go+11 added-1 removed
27 unmodified lines
28 offset int29 yanked []rune30 input []rune31 multi bool32 sort bool33 toggleSort int34 expect []int35 pressed int36 printQuery bool
59 unmodified lines
96 offset: 0,97 yanked: []rune{},98 input: input,99 multi: opts.Multi,100 sort: opts.Sort > 0,101 toggleSort: opts.ToggleSort,102 expect: opts.Expect,103 pressed: 0,104 printQuery: opts.PrintQuery,
137 unmodified lines
242 }243244 t.move(1, 2, false)245 output := fmt.Sprintf("%d/%d", t.merger.Length(), t.count)246 if t.toggleSort > 0 {247 if t.sort {248 output += "/S"249 } else {250 output += " "251 }252 }253 if t.multi && len(t.selected) > 0 {254 output += fmt.Sprintf(" (%d)", len(t.selected))255 }256 if t.progress > 0 && t.progress < 100 {
330 unmodified lines
587 }588 }589 if t.toggleSort > 0 {590 if keyMatch(t.toggleSort, event) {591 t.sort = !t.sort582 t.eventBox.Set(EvtSearchNew, true)592 t.eventBox.Set(EvtSearchNew, t.sort)593 t.mutex.Unlock()594 continue595 }596 }
175 unmodified lines
modified:CHANGELOG.md+1 added