mirror of
https://github.com/Hopiu/micro.git
synced 2026-03-17 06:20:28 +00:00
parent
6229a0579f
commit
cb75531818
3 changed files with 12 additions and 13 deletions
|
|
@ -188,10 +188,6 @@ func NewBuffer(reader io.Reader, size int64, path string) *Buffer {
|
|||
file.Close()
|
||||
}
|
||||
|
||||
if b.Settings["mouse"].(bool) {
|
||||
screen.EnableMouse()
|
||||
}
|
||||
|
||||
if !b.Settings["fastdirty"].(bool) {
|
||||
b.origHash = md5.Sum([]byte(b.String()))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,6 +202,10 @@ func InitScreen() {
|
|||
os.Setenv("TERM", oldTerm)
|
||||
}
|
||||
|
||||
if GetGlobalOption("mouse").(bool) {
|
||||
screen.EnableMouse()
|
||||
}
|
||||
|
||||
screen.SetStyle(defStyle)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -243,7 +243,6 @@ func DefaultLocalSettings() map[string]interface{} {
|
|||
"filetype": "Unknown",
|
||||
"ignorecase": false,
|
||||
"indentchar": " ",
|
||||
"mouse": true,
|
||||
"rmtrailingws": false,
|
||||
"ruler": true,
|
||||
"savecursor": false,
|
||||
|
|
@ -318,6 +317,14 @@ func SetOption(option, value string) error {
|
|||
}
|
||||
}
|
||||
|
||||
if option == "mouse" {
|
||||
if !nativeValue.(bool) {
|
||||
screen.DisableMouse()
|
||||
} else {
|
||||
screen.EnableMouse()
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := CurView().Buf.Settings[option]; ok {
|
||||
for _, tab := range tabs {
|
||||
for _, view := range tab.views {
|
||||
|
|
@ -405,14 +412,6 @@ func SetLocalOption(option, value string, view *View) error {
|
|||
}
|
||||
}
|
||||
|
||||
if option == "mouse" {
|
||||
if !nativeValue.(bool) {
|
||||
screen.DisableMouse()
|
||||
} else {
|
||||
screen.EnableMouse()
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue