Add option to disable clearing screen

Somewhat hacky and might cause other issues, but should fix #365
This commit is contained in:
Tulir Asokan 2022-04-25 00:25:49 +03:00
parent b4101f5518
commit 6479ff2e34
4 changed files with 7 additions and 3 deletions

View File

@ -116,6 +116,8 @@ type Config struct {
Backspace1RemovesWord bool `yaml:"backspace1_removes_word"` Backspace1RemovesWord bool `yaml:"backspace1_removes_word"`
Backspace2RemovesWord bool `yaml:"backspace2_removes_word"` Backspace2RemovesWord bool `yaml:"backspace2_removes_word"`
AlwaysClearScreen bool `yaml:"always_clear_screen"`
Dir string `yaml:"-"` Dir string `yaml:"-"`
DataDir string `yaml:"data_dir"` DataDir string `yaml:"data_dir"`
CacheDir string `yaml:"cache_dir"` CacheDir string `yaml:"cache_dir"`
@ -152,6 +154,7 @@ func NewConfig(configDir, dataDir, cacheDir, downloadDir string) *Config {
NotifySound: true, NotifySound: true,
SendToVerifiedOnly: false, SendToVerifiedOnly: false,
Backspace1RemovesWord: true, Backspace1RemovesWord: true,
AlwaysClearScreen: true,
} }
} }

2
go.mod
View File

@ -17,7 +17,7 @@ require (
github.com/zyedidia/clipboard v1.0.3 github.com/zyedidia/clipboard v1.0.3
go.etcd.io/bbolt v1.3.6 go.etcd.io/bbolt v1.3.6
go.mau.fi/cbind v0.0.0-20220415094356-e1d579b7925e go.mau.fi/cbind v0.0.0-20220415094356-e1d579b7925e
go.mau.fi/mauview v0.1.4-0.20220417205338-69b850bc4440 go.mau.fi/mauview v0.1.4-0.20220424212347-bfa59b8f6ad0
go.mau.fi/tcell v0.0.0-20220417202829-9f14d62226c5 go.mau.fi/tcell v0.0.0-20220417202829-9f14d62226c5
golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9 golang.org/x/image v0.0.0-20220413100746-70e8d0d3baa9
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 golang.org/x/net v0.0.0-20220412020605-290c469a71a5

4
go.sum
View File

@ -63,8 +63,8 @@ go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU=
go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4=
go.mau.fi/cbind v0.0.0-20220415094356-e1d579b7925e h1:zY4TZmHAaUhrMFJQfh02dqxDYSfnnXlw/qRoFanxZTw= go.mau.fi/cbind v0.0.0-20220415094356-e1d579b7925e h1:zY4TZmHAaUhrMFJQfh02dqxDYSfnnXlw/qRoFanxZTw=
go.mau.fi/cbind v0.0.0-20220415094356-e1d579b7925e/go.mod h1:9nnzlslhUo/xO+8tsQgkFqG/W+SgD+r0iTYAuglzlmA= go.mau.fi/cbind v0.0.0-20220415094356-e1d579b7925e/go.mod h1:9nnzlslhUo/xO+8tsQgkFqG/W+SgD+r0iTYAuglzlmA=
go.mau.fi/mauview v0.1.4-0.20220417205338-69b850bc4440 h1:DegGruuno4o8/+cc9/Vck11amgHY0jXoCEdjnt05eIA= go.mau.fi/mauview v0.1.4-0.20220424212347-bfa59b8f6ad0 h1:ln2H+b3fxErpUVu+TyFKb0Gq3zMQdIanTlsQqt5SSDo=
go.mau.fi/mauview v0.1.4-0.20220417205338-69b850bc4440/go.mod h1:6bDnPL+UUkFvg0ueTlBQr1VcQwWJ4v8c+1ezoAG/Q5w= go.mau.fi/mauview v0.1.4-0.20220424212347-bfa59b8f6ad0/go.mod h1:6bDnPL+UUkFvg0ueTlBQr1VcQwWJ4v8c+1ezoAG/Q5w=
go.mau.fi/tcell v0.0.0-20220415093808-07c67d224693/go.mod h1:HQLPCz9v8YfYewMetOKrg9pe87XEyNcIfCYYq8VxQbU= go.mau.fi/tcell v0.0.0-20220415093808-07c67d224693/go.mod h1:HQLPCz9v8YfYewMetOKrg9pe87XEyNcIfCYYq8VxQbU=
go.mau.fi/tcell v0.0.0-20220417202829-9f14d62226c5 h1:JhL64rfGvgjnaaVmUTcG46hW9L48hxLlWtsIvQKeARY= go.mau.fi/tcell v0.0.0-20220417202829-9f14d62226c5 h1:JhL64rfGvgjnaaVmUTcG46hW9L48hxLlWtsIvQKeARY=
go.mau.fi/tcell v0.0.0-20220417202829-9f14d62226c5/go.mod h1:Nq9HUYmTdDVZnEyh5xzJR9tdamalR1yzAxq9BClI8EY= go.mau.fi/tcell v0.0.0-20220417202829-9f14d62226c5/go.mod h1:Nq9HUYmTdDVZnEyh5xzJR9tdamalR1yzAxq9BClI8EY=

View File

@ -67,6 +67,7 @@ func NewGomuksUI(gmx ifc.Gomuks) ifc.GomuksUI {
func (ui *GomuksUI) Init() { func (ui *GomuksUI) Init() {
mauview.Backspace2RemovesWord = ui.gmx.Config().Backspace2RemovesWord mauview.Backspace2RemovesWord = ui.gmx.Config().Backspace2RemovesWord
mauview.Backspace1RemovesWord = ui.gmx.Config().Backspace1RemovesWord mauview.Backspace1RemovesWord = ui.gmx.Config().Backspace1RemovesWord
ui.app.SetAlwaysClear(ui.gmx.Config().AlwaysClearScreen)
clipboard.Initialize() clipboard.Initialize()
ui.views = map[View]mauview.Component{ ui.views = map[View]mauview.Component{
ViewLogin: ui.NewLoginView(), ViewLogin: ui.NewLoginView(),