summary refs log tree commit diff stats
path: root/lib/ui
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ui')
-rw-r--r--lib/ui/tab.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/ui/tab.go b/lib/ui/tab.go
index b6e7bd5..90c7ce9 100644
--- a/lib/ui/tab.go
+++ b/lib/ui/tab.go
@@ -167,8 +167,15 @@ func (strip *TabStrip) Draw(ctx *Context) {
 		if strip.Selected == i {
 			style = tcell.StyleDefault
 		}
-		trunc := runewidth.Truncate(tab.Name, 32, "…")
+		tabWidth := 32
+		if ctx.Width()-x < tabWidth {
+			tabWidth = ctx.Width() - x - 2
+		}
+		trunc := runewidth.Truncate(tab.Name, tabWidth, "…")
 		x += ctx.Printf(x, 0, style, " %s ", trunc)
+		if x >= ctx.Width() {
+			break
+		}
 	}
 	style := tcell.StyleDefault.Reverse(true)
 	ctx.Fill(x, 0, ctx.Width()-x, 1, ' ', style)
3b0c018491b7b49343c1a7c260b3a725b8a659e'>^
e6b076ce ^


78bd151c ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41