]> git.lizzy.rs Git - micro.git/blobdiff - internal/display/statusline.go
Added lines and percentage statusbar directives (#2055)
[micro.git] / internal / display / statusline.go
index 947a3ee7b48b828dce783829f0367ac6f8ddfa2f..be808eeec8c8604279b09b2dee453c1e5f44dd24 100644 (file)
@@ -47,6 +47,12 @@ var statusInfo = map[string]func(*buffer.Buffer) string{
                }
                return ""
        },
+       "lines": func(b *buffer.Buffer) string {
+               return strconv.Itoa(b.LinesNum())
+       },
+       "percentage": func(b *buffer.Buffer) string {
+               return strconv.Itoa((b.GetActiveCursor().Y + 1) * 100 / b.LinesNum())
+       },
 }
 
 func SetStatusInfoFnLua(fn string) {