mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-06 23:20:18 +09:00
File diff suppressed because one or more lines are too long
@@ -78,6 +78,7 @@ func DefaultSettings() map[string]interface{} {
|
||||
"syntax": true,
|
||||
"tabsToSpaces": false,
|
||||
"ruler": true,
|
||||
"statusline": true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,6 +118,10 @@ func SetOption(view *View, args []string) {
|
||||
view.Buf.UpdateRules()
|
||||
}
|
||||
|
||||
if option == "statusline" {
|
||||
view.Resize(screen.Size())
|
||||
}
|
||||
|
||||
err := WriteSettings(filename)
|
||||
if err != nil {
|
||||
messenger.Error("Error writing to settings.json: " + err.Error())
|
||||
|
||||
@@ -110,7 +110,11 @@ func (v *View) Resize(w, h int) {
|
||||
h--
|
||||
v.width = int(float32(w) * float32(v.widthPercent) / 100)
|
||||
// We subtract 1 for the statusline
|
||||
v.height = int(float32(h)*float32(v.heightPercent)/100) - 1
|
||||
v.height = int(float32(h) * float32(v.heightPercent) / 100)
|
||||
if settings["statusline"].(bool) {
|
||||
// Make room for the status line if it is enabled
|
||||
v.height--
|
||||
}
|
||||
}
|
||||
|
||||
// ScrollUp scrolls the view up n lines (if possible)
|
||||
@@ -581,5 +585,7 @@ func (v *View) DisplayView() {
|
||||
func (v *View) Display() {
|
||||
v.DisplayView()
|
||||
v.Cursor.Display()
|
||||
v.sline.Display()
|
||||
if settings["statusline"].(bool) {
|
||||
v.sline.Display()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,6 +195,10 @@ Here are the options that you can set:
|
||||
|
||||
default value: `on`
|
||||
|
||||
* `statusline`: display the status line at the bottom of the screen
|
||||
|
||||
default value: `on`
|
||||
|
||||
---
|
||||
|
||||
Default plugin options:
|
||||
|
||||
Reference in New Issue
Block a user