mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 23:05:40 -04:00
Add mouse option to allow disabling mouse support
This commit is contained in:
parent
404e5d206d
commit
90977fb4e1
@ -184,6 +184,10 @@ func NewBuffer(reader io.Reader, size int64, path string) *Buffer {
|
|||||||
file.Close()
|
file.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if b.Settings["mouse"].(bool) {
|
||||||
|
screen.EnableMouse()
|
||||||
|
}
|
||||||
|
|
||||||
b.cursors = []*Cursor{&b.Cursor}
|
b.cursors = []*Cursor{&b.Cursor}
|
||||||
|
|
||||||
return b
|
return b
|
||||||
|
@ -198,7 +198,6 @@ func InitScreen() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
screen.SetStyle(defStyle)
|
screen.SetStyle(defStyle)
|
||||||
screen.EnableMouse()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RedrawAll redraws everything -- all the views and the messenger
|
// RedrawAll redraws everything -- all the views and the messenger
|
||||||
|
File diff suppressed because one or more lines are too long
@ -222,6 +222,7 @@ func DefaultGlobalSettings() map[string]interface{} {
|
|||||||
"pluginrepos": []string{},
|
"pluginrepos": []string{},
|
||||||
"useprimary": true,
|
"useprimary": true,
|
||||||
"fileformat": "unix",
|
"fileformat": "unix",
|
||||||
|
"mouse": true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,6 +255,7 @@ func DefaultLocalSettings() map[string]interface{} {
|
|||||||
"tabstospaces": false,
|
"tabstospaces": false,
|
||||||
"useprimary": true,
|
"useprimary": true,
|
||||||
"fileformat": "unix",
|
"fileformat": "unix",
|
||||||
|
"mouse": true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,6 +382,14 @@ func SetLocalOption(option, value string, view *View) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if option == "mouse" {
|
||||||
|
if !nativeValue.(bool) {
|
||||||
|
screen.DisableMouse()
|
||||||
|
} else {
|
||||||
|
screen.EnableMouse()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,6 +155,12 @@ Here are the options that you can set:
|
|||||||
|
|
||||||
default value: `off`
|
default value: `off`
|
||||||
|
|
||||||
|
* `mouse`: whether to enable mouse support. When mouse support is disabled, usually the terminal will be able
|
||||||
|
to access mouse events which can be useful if you want to copy from the terminal instead of from micro (if
|
||||||
|
over ssh for example, because the terminal has access to the local clipboard and micro does not).
|
||||||
|
|
||||||
|
default value: `on`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Default plugin options:
|
Default plugin options:
|
||||||
|
Loading…
Reference in New Issue
Block a user