]> git.lizzy.rs Git - micro.git/commitdiff
Fix tabbar offset with splits
authorZachary Yedidia <zyedidia@gmail.com>
Wed, 29 Jun 2016 01:33:10 +0000 (21:33 -0400)
committerZachary Yedidia <zyedidia@gmail.com>
Sat, 2 Jul 2016 21:41:23 +0000 (17:41 -0400)
cmd/micro/highlighter.go
cmd/micro/view.go

index 03c85e2fdec9d8c600715354c1ea8b3f3d1d834e..32fe656324b4f54739f2c724f10a61ea709f1bd4 100644 (file)
@@ -152,6 +152,9 @@ func LoadSyntaxFilesFromDir(dir string) {
        if style, ok := colorscheme["default"]; ok {
                defStyle = style
        }
        if style, ok := colorscheme["default"]; ok {
                defStyle = style
        }
+       if screen != nil {
+               screen.SetStyle(defStyle)
+       }
 
        syntaxFiles = make(map[[2]*regexp.Regexp]FileTypeRules)
        files, _ := ioutil.ReadDir(dir)
 
        syntaxFiles = make(map[[2]*regexp.Regexp]FileTypeRules)
        files, _ := ioutil.ReadDir(dir)
index 7d26e7b51711207218f259bd32fcdd591f5c619e..ff004fb94858d03b17b19549f70f69d903db185a 100644 (file)
@@ -123,13 +123,17 @@ func NewViewWidthHeight(buf *Buffer, w, h int) *View {
 func (v *View) Resize(w, h int) {
        // Always include 1 line for the command line at the bottom
        h--
 func (v *View) Resize(w, h int) {
        // Always include 1 line for the command line at the bottom
        h--
-       // if len(tabs) > 1 {
-       //      // Include one line for the tab bar at the top
-       //      h--
-       //      v.y = 1
-       // } else {
-       //      v.y = 0
-       // }
+       if len(tabs) > 1 {
+               if v.y == 0 {
+                       // Include one line for the tab bar at the top
+                       h--
+                       v.y = 1
+               }
+       } else {
+               if v.y == 1 {
+                       v.y = 0
+               }
+       }
        v.width = int(float32(w) * float32(v.widthPercent) / 100)
        // We subtract 1 for the statusline
        v.height = int(float32(h) * float32(v.heightPercent) / 100)
        v.width = int(float32(w) * float32(v.widthPercent) / 100)
        // We subtract 1 for the statusline
        v.height = int(float32(h) * float32(v.heightPercent) / 100)