Add ScrollOffMargin user config

When set to a non-zero value, views will scroll when the selection gets this
close to the top or bottom of the view.
This commit is contained in:
Stefan Haller
2023-08-09 18:34:43 +02:00
parent 8f164f7bc5
commit 341b9725d4
6 changed files with 262 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ type GuiConfig struct {
BranchColors map[string]string `yaml:"branchColors"`
ScrollHeight int `yaml:"scrollHeight"`
ScrollPastBottom bool `yaml:"scrollPastBottom"`
ScrollOffMargin int `yaml:"scrollOffMargin"`
MouseEvents bool `yaml:"mouseEvents"`
SkipDiscardChangeWarning bool `yaml:"skipDiscardChangeWarning"`
SkipStashWarning bool `yaml:"skipStashWarning"`
@@ -418,6 +419,7 @@ func GetDefaultConfig() *UserConfig {
Gui: GuiConfig{
ScrollHeight: 2,
ScrollPastBottom: true,
ScrollOffMargin: 2,
MouseEvents: true,
SkipDiscardChangeWarning: false,
SkipStashWarning: false,