summaryrefslogtreecommitdiff
path: root/ui/ui.go
diff options
context:
space:
mode:
authorAlexey Yerin <yyp@disroot.org>2021-04-27 21:22:35 +0300
committerHubert Hirtz <hubert@hirtz.pm>2021-04-28 10:13:54 +0200
commitb455cc9ad7694268346e26fc44a7f6cd7524e877 (patch)
tree271bdf9fded36b54393dc8ce35b7b9cff0473286 /ui/ui.go
parentMake sure app.s is not nil when issuing quit (diff)
Make mouse support optional
To not break existing users, mouse is enabled by default but you have an option to disable it with "mouse: false" in your /.confg/senpai/senpai.yaml.
Diffstat (limited to '')
-rw-r--r--ui/ui.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/ui.go b/ui/ui.go
index 86608d1..9f730a3 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -12,6 +12,7 @@ type Config struct {
NickColWidth int
ChanColWidth int
AutoComplete func(cursorIdx int, text []rune) []Completion
+ Mouse bool
}
type UI struct {
@@ -40,7 +41,9 @@ func New(config Config) (ui *UI, err error) {
if err != nil {
return
}
- ui.screen.EnableMouse()
+ if ui.screen.HasMouse() && config.Mouse {
+ ui.screen.EnableMouse()
+ }
ui.screen.EnablePaste()
w, h := ui.screen.Size()