From dc8da605f9b250c9b74dcbc4d907ff17e5341424 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 16 Jan 2023 19:55:44 +0900 Subject: [PATCH] Fix rendering of double-column borders on light renderer --- src/tui/light.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tui/light.go b/src/tui/light.go index 578118b..a336cac 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -789,7 +789,8 @@ func (w *LightWindow) drawBorderAround() { vw := runewidth.RuneWidth(w.border.vertical) tcw := runewidth.RuneWidth(w.border.topLeft) + runewidth.RuneWidth(w.border.topRight) bcw := runewidth.RuneWidth(w.border.bottomLeft) + runewidth.RuneWidth(w.border.bottomRight) - w.CPrint(color, string(w.border.topLeft)+repeat(w.border.horizontal, (w.width-tcw)/hw)+string(w.border.topRight)) + rem := (w.width - tcw) % hw + w.CPrint(color, string(w.border.topLeft)+repeat(w.border.horizontal, (w.width-tcw)/hw)+repeat(' ', rem)+string(w.border.topRight)) for y := 1; y < w.height-1; y++ { w.Move(y, 0) w.CPrint(color, string(w.border.vertical)) @@ -797,7 +798,8 @@ func (w *LightWindow) drawBorderAround() { w.CPrint(color, string(w.border.vertical)) } w.Move(w.height-1, 0) - w.CPrint(color, string(w.border.bottomLeft)+repeat(w.border.horizontal, (w.width-bcw)/hw)+string(w.border.bottomRight)) + rem = (w.width - bcw) % hw + w.CPrint(color, string(w.border.bottomLeft)+repeat(w.border.horizontal, (w.width-bcw)/hw)+repeat(' ', rem)+string(w.border.bottomRight)) } func (w *LightWindow) csi(code string) {