Use tabbar color group, and mark modified tabs

Fixes #1523
This commit is contained in:
Zachary Yedidia
2020-02-24 13:45:10 -05:00
parent 0174d7dba4
commit 8a2048e7f6
2 changed files with 13 additions and 4 deletions

View File

@@ -270,7 +270,11 @@ func (h *BufPane) SetID(i uint64) {
}
func (h *BufPane) Name() string {
return h.Buf.GetName()
n := h.Buf.GetName()
if h.Buf.Modified() {
n += " +"
}
return n
}
// HandleEvent executes the tcell event properly

View File

@@ -96,6 +96,11 @@ func (w *TabWindow) Display() {
x := -w.hscroll
done := false
tabBarStyle := config.DefStyle.Reverse(true)
if style, ok := config.Colorscheme["tabbar"]; ok {
tabBarStyle = style
}
draw := func(r rune, n int) {
for i := 0; i < n; i++ {
rw := runewidth.RuneWidth(r)
@@ -105,13 +110,13 @@ func (w *TabWindow) Display() {
c = ' '
}
if x == w.Width-1 && !done {
screen.SetContent(w.Width-1, w.Y, '>', nil, config.DefStyle.Reverse(true))
screen.SetContent(w.Width-1, w.Y, '>', nil, tabBarStyle)
x++
break
} else if x == 0 && w.hscroll > 0 {
screen.SetContent(0, w.Y, '<', nil, config.DefStyle.Reverse(true))
screen.SetContent(0, w.Y, '<', nil, tabBarStyle)
} else if x >= 0 && x < w.Width {
screen.SetContent(x, w.Y, c, nil, config.DefStyle.Reverse(true))
screen.SetContent(x, w.Y, c, nil, tabBarStyle)
}
x++
}