]> git.lizzy.rs Git - micro.git/blobdiff - cmd/micro/tab.go
Initial support for terminal within micro
[micro.git] / cmd / micro / tab.go
index bbdd7eb0cffcad1169dfd922cba54ff2ce3bbd9d..650ce269769f7054064200c8e2f6daa4ce8fa63c 100644 (file)
@@ -36,6 +36,9 @@ func NewTabFromView(v *View) *Tab {
        if globalSettings["infobar"].(bool) {
                t.tree.height--
        }
+       if globalSettings["keymenu"].(bool) {
+               t.tree.height -= 2
+       }
 
        t.Resize()
 
@@ -62,11 +65,17 @@ func (t *Tab) Resize() {
        if globalSettings["infobar"].(bool) {
                t.tree.height--
        }
+       if globalSettings["keymenu"].(bool) {
+               t.tree.height -= 2
+       }
 
        t.tree.ResizeSplits()
 
        for i, v := range t.views {
                v.Num = i
+               if v.Type == vtTerm {
+                       v.term.Resize(v.Width, v.Height)
+               }
        }
 }
 
@@ -89,13 +98,17 @@ func TabbarString() (string, map[int]int) {
                } else {
                        str += " "
                }
-               str += t.views[t.CurView].Buf.GetName()
+               buf := t.views[t.CurView].Buf
+               str += buf.GetName()
+               if buf.Modified() {
+                       str += " +"
+               }
                if i == curTab {
                        str += "]"
                } else {
                        str += " "
                }
-               indicies[len(str)-1] = i + 1
+               indicies[Count(str)-1] = i + 1
                str += " "
        }
        return str, indicies