Fix rendering glitch with preview window on the left + footer
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 367177d · Browse files · 1 file·+20 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
1 file+20 added−12 removed
- other:+20 added−12 removed
Provenance
- Commit
67319ae- Tree
b5c391e- Author
Junegunn Choi <junegunn.c@gmail.com>- Committer
Junegunn Choi <junegunn.c@gmail.com>- Parent
367177d
1 file changed+20 added−12 removed
modified:src/terminal.go+20 added-12 removed
2621 unmodified lines2622 (!t.headerVisible || !t.headerBorderShape.HasRight() || t.visibleHeaderLines() == 0)2623 2624 // Set up preview window2625 noBorder := tui.MakeBorderStyle(tui.BorderNone, t.unicode)2626+ cleanLeft := []int{}2627 if forcePreview || t.needPreviewWindow() {2628 var resizePreviewWindows func(previewOpts *previewOpts)2629 resizePreviewWindows = func(previewOpts *previewOpts) {2630 t.activePreviewOpts = previewOpts110 unmodified lines2741 t.window = t.tui.NewWindow(2742 innerMarginInt[0]+shift+inlineTopLines, innerMarginInt[3]+pwidth+m, innerWidth-pwidth-m, innerHeight-shrink-inlineTopLines-inlineBottomLines, tui.WindowList, noBorder, true)2743 2744 // Clear characters on the margin2744- // fzf --bind 'space:toggle-preview' --preview ':' --preview-window left,12745- if !hasListBorder {2746- for y := 0; y < innerHeight; y++ {2747- t.window.Move(y, -1)2748- t.window.Print(" ")2749- }2750- }2751- // fzf --bind 'space:toggle-preview' --preview ':' --preview-window left,1,border-none2745+ // fzf --bind 'space:toggle-preview' --preview ':' --preview-window left,1,border-none --footer-border --footer f --header h --header-border2746 if !previewOpts.Border().HasRight() {2753- for y := 0; y < innerHeight; y++ {2754- t.window.Move(y, -2)2755- t.window.Print(" ")2756- }2747+ cleanLeft = append(cleanLeft, -2)2748 }2749+ // fzf --bind 'space:toggle-preview' --preview ':' --preview-window left,1 --footer-border --footer f --header h --header-border2750+ if !hasListBorder {2751+ cleanLeft = append(cleanLeft, -1)2752+ }2753 2754 innerBorderFn(marginInt[0], marginInt[3]+pwidth, width-pwidth, height)2755 createPreviewWindow(marginInt[0], marginInt[3], pwidth, height)2756 } else {217 unmodified lines2974 footerBorderHeight, tui.WindowFooter, tui.MakeBorderStyle(t.footerBorderShape, t.unicode), true)2975 t.footerWindow = createInnerWindow(t.footerBorder, t.footerBorderShape, tui.WindowFooter, 0)2976 }2977 2978+ for _, w := range []tui.Window{t.window, t.headerBorder, t.headerLinesBorder, t.footerBorder, t.inputBorder} {2979+ if w == nil {2980+ continue2981+ }2982+2983+ for y := 0; y < w.Height(); y++ {2984+ for _, left := range cleanLeft {2985+ w.Move(y, left)2986+ w.Print(" ")2987+ }2988+ }2989+ }2990+2991 // When the list label lands on an edge owned by an inline section, swap its bg2992 // so the label reads as part of that section's frame. Fg stays at list-label.2993 listLabel, listLabelLen := t.listLabel, t.listLabelLen2994 var adjacentSection *inlineSlot5270 unmodified lines