From d2b11c2f982fa14d3c931c812cbc202621bb4c35 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Tue, 28 Jun 2016 21:33:10 -0400 Subject: [PATCH] Fix tabbar offset with splits --- cmd/micro/highlighter.go | 3 +++ cmd/micro/view.go | 18 +++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/cmd/micro/highlighter.go b/cmd/micro/highlighter.go index 03c85e2f..32fe6563 100644 --- a/cmd/micro/highlighter.go +++ b/cmd/micro/highlighter.go @@ -152,6 +152,9 @@ func LoadSyntaxFilesFromDir(dir string) { 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) diff --git a/cmd/micro/view.go b/cmd/micro/view.go index 7d26e7b5..ff004fb9 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -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-- - // 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) -- 2.44.0