]> git.lizzy.rs Git - micro.git/commitdiff
Use tabbar color group, and mark modified tabs
authorZachary Yedidia <zyedidia@gmail.com>
Mon, 24 Feb 2020 18:45:10 +0000 (13:45 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Mon, 24 Feb 2020 18:45:10 +0000 (13:45 -0500)
Fixes #1523

internal/action/bufpane.go
internal/display/tabwindow.go

index d63f0a2056a8a6c06c303121cc1dfc35a27adcb0..7351f1f76fe2b62f1522b74e09d3ba7ad20ca9b6 100644 (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
index 0b26fd7b49288dad8fc8ab96a7f3309df8d1c4a3..94bdc23a83b560b89f35f5f613dfa2c1b3accbfc 100644 (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++
                        }