Skip to content
Myr

Less flickering of the candidate list when resizing the preview window

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 20d5b2e · Browse files · 1 file+10 added−5 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+10 added−5 removed

  • other:+10 added−5 removed

1 file+10 added−5 removed

modified:src/terminal.go+10 added-5 removed
2159 unmodified lines
2160 return line + numLines - 12161 }21622163 maxWidth := t.window.Width() - (t.pointerLen + t.markerLen + 1)2164 postTask := func(lineNum int, width int, wrapped bool) {2164 postTask := func(lineNum int, width int, wrapped bool, forceRedraw bool) {2165 if (current || selected) && t.highlightLine {2166 color := tui.ColSelected2167 if current {2168 color = tui.ColCurrent
6 unmodified lines
2175 t.window.CPrint(color, strings.Repeat(" ", fillSpaces))2176 }2177 newLine.width = maxWidth2178 } else {2179 var fillSpaces int2180 if forceRedraw {2181 fillSpaces = maxWidth - width2182 } else {2179 fillSpaces := t.prevLines[lineNum].width - width2183 fillSpaces = t.prevLines[lineNum].width - width2184 }2185 if wrapped {2186 fillSpaces -= t.wrapSignWidth2187 }2188 if fillSpaces > 0 {
103 unmodified lines
2292func (t *Terminal) overflow(runes []rune, max int) bool {2293 return t.displayWidthWithLimit(runes, 0, max) > max2294}22952291func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMatch tui.ColorPair, current bool, match bool, lineNum int, maxLineNum int, forceRedraw bool, preTask func(markerClass), postTask func(int, int, bool)) int {2296func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMatch tui.ColorPair, current bool, match bool, lineNum int, maxLineNum int, forceRedraw bool, preTask func(markerClass), postTask func(int, int, bool, bool)) int {2297 var displayWidth int2298 item := result.item2299 matchOffsets := []Offset{}2300 var pos *[]int
84 unmodified lines
2385 actualLineNum := lineNum2386 if t.layout == layoutDefault {2387 actualLineNum = (lineNum - actualLineOffset) + (numItemLines - actualLineOffset) - 12388 }2384 t.move(actualLineNum, 0, forceRedraw)2389 t.move(actualLineNum, 0, forceRedraw && postTask == nil)23902391 if preTask != nil {2392 var marker markerClass2393 if numItemLines == 1 {
95 unmodified lines
2489 }24902491 t.printColoredString(t.window, line, offsets, colBase)2492 if postTask != nil {2488 postTask(actualLineNum, displayWidth, wasWrapped)2493 postTask(actualLineNum, displayWidth, wasWrapped, forceRedraw)2494 } else {2495 t.markOtherLine(actualLineNum)2496 }2497 lineNum += 1
2772 unmodified lines