mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 14:55:38 -04:00
statusline: Provide overwrite
mode indicator
This commit is contained in:
parent
c61670e86f
commit
57a6e81ddb
@ -93,7 +93,7 @@ var defaultCommonSettings = map[string]interface{}{
|
||||
"softwrap": false,
|
||||
"splitbottom": true,
|
||||
"splitright": true,
|
||||
"statusformatl": "$(filename) $(modified)($(line),$(col)) $(status.paste)| ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)",
|
||||
"statusformatl": "$(filename) $(modified)$(overwrite)($(line),$(col)) $(status.paste)| ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)",
|
||||
"statusformatr": "$(bind:ToggleKeyMenu): bindings, $(bind:ToggleHelp): help",
|
||||
"statusline": true,
|
||||
"syntax": true,
|
||||
|
@ -47,6 +47,12 @@ var statusInfo = map[string]func(*buffer.Buffer) string{
|
||||
}
|
||||
return ""
|
||||
},
|
||||
"overwrite": func(b *buffer.Buffer) string {
|
||||
if b.OverwriteMode && !b.Type.Readonly {
|
||||
return "[ovwr] "
|
||||
}
|
||||
return ""
|
||||
},
|
||||
"lines": func(b *buffer.Buffer) string {
|
||||
return strconv.Itoa(b.LinesNum())
|
||||
},
|
||||
|
@ -415,11 +415,11 @@ 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`, `lines`,
|
||||
`percentage`, `opt`, `bind`.
|
||||
`percentage`, `opt`, `overwrite`, `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.
|
||||
|
||||
default value: `$(filename) $(modified)($(line),$(col)) $(status.paste)|
|
||||
default value: `$(filename) $(modified)$(overwrite)($(line),$(col)) $(status.paste)|
|
||||
ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)`
|
||||
|
||||
* `statusformatr`: format string definition for the right-justified part of the
|
||||
@ -578,7 +578,7 @@ so that you can see what the formatting should look like.
|
||||
"splitbottom": true,
|
||||
"splitright": true,
|
||||
"status": true,
|
||||
"statusformatl": "$(filename) $(modified)($(line),$(col)) $(status.paste)| ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)",
|
||||
"statusformatl": "$(filename) $(modified)$(overwrite)($(line),$(col)) $(status.paste)| ft:$(opt:filetype) | $(opt:fileformat) | $(opt:encoding)",
|
||||
"statusformatr": "$(bind:ToggleKeyMenu): bindings, $(bind:ToggleHelp): help",
|
||||
"statusline": true,
|
||||
"sucmd": "sudo",
|
||||
|
Loading…
Reference in New Issue
Block a user