mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-16 22:10:26 +00:00
Added lines and percentage statusbar directives (#2055)
- "lines" for the number of lines in the buffer - "percentage" for the percentage of the file at the current line Fixes zyedidia#2049
This commit is contained in:
parent
fe59e18e69
commit
987e409071
2 changed files with 7 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ Here are the available options:
|
|||
|
||||
* `statusformatl`: format string definition for the left-justified part of the
|
||||
statusline. Special directives should be placed inside `$()`. Special
|
||||
directives include: `filename`, `modified`, `line`, `col`, `opt`, `bind`.
|
||||
directives include: `filename`, `modified`, `line`, `col`, `lines`, `percentage`, `opt`, `bind`.
|
||||
The `opt` and `bind` directives take either an option or an action afterward
|
||||
and fill in the value of the option or the key bound to the action.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue