]> git.lizzy.rs Git - micro.git/blobdiff - cmd/micro/statusline.go
Don't draw statusline if infobar is off and in use
[micro.git] / cmd / micro / statusline.go
index e339cf194264175ef445e204f231f9778120a46a..2605ef9b79413d26975ff401f6e2e883d9e657cc 100644 (file)
@@ -14,13 +14,17 @@ type Statusline struct {
 
 // Display draws the statusline to the screen
 func (sline *Statusline) Display() {
+       if messenger.hasPrompt && !GetGlobalOption("infobar").(bool) {
+               return
+       }
+
        // We'll draw the line at the lowest line in the view
        y := sline.view.Height + sline.view.y
 
        file := sline.view.Buf.GetName()
 
        // If the buffer is dirty (has been modified) write a little '+'
-       if sline.view.Buf.IsModified {
+       if sline.view.Buf.Modified() {
                file += " +"
        }
 
@@ -36,13 +40,27 @@ func (sline *Statusline) Display() {
        // Add the filetype
        file += " " + sline.view.Buf.FileType()
 
+       file += " " + sline.view.Buf.Settings["fileformat"].(string)
+
        rightText := ""
+       if len(kmenuBinding) > 0 {
+               if globalSettings["keymenu"].(bool) {
+                       rightText += kmenuBinding + ": hide bindings"
+               } else {
+                       rightText += kmenuBinding + ": show bindings"
+               }
+       }
        if len(helpBinding) > 0 {
-               rightText = helpBinding + " for help "
+               if len(kmenuBinding) > 0 {
+                       rightText += ", "
+               }
                if sline.view.Type == vtHelp {
-                       rightText = helpBinding + " to close help "
+                       rightText += helpBinding + ": close help"
+               } else {
+                       rightText += helpBinding + ": open help"
                }
        }
+       rightText += " "
 
        statusLineStyle := defStyle.Reverse(true)
        if style, ok := colorscheme["statusline"]; ok {