summaryrefslogtreecommitdiffstats
path: root/src/tui/light.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2023-01-16 19:55:44 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2023-01-16 19:55:44 +0900
commitdc8da605f9b250c9b74dcbc4d907ff17e5341424 (patch)
tree433bbaf0ec773145eed67755b316e8f0a9f734ea /src/tui/light.go
parent8b299a29c7024a0578c950bb9d1fbdb58fe4ac6c (diff)
Fix rendering of double-column borders on light renderer
Diffstat (limited to 'src/tui/light.go')
-rw-r--r--src/tui/light.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tui/light.go b/src/tui/light.go
index 578118b7..a336cac0 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) {