mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-18 22:44:50 +02:00
Implement using effective kitty config options for kittens
Also centralise reading of kitty options
This commit is contained in:
@@ -4,7 +4,6 @@ package diff
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -25,7 +24,7 @@ type KittyOpts struct {
|
||||
Copy_on_select bool
|
||||
}
|
||||
|
||||
func read_relevant_kitty_opts(path string) KittyOpts {
|
||||
func read_relevant_kitty_opts() KittyOpts {
|
||||
ans := KittyOpts{Wheel_scroll_multiplier: kitty.KittyConfigDefaults.Wheel_scroll_multiplier}
|
||||
handle_line := func(key, val string) error {
|
||||
switch key {
|
||||
@@ -39,13 +38,12 @@ func read_relevant_kitty_opts(path string) KittyOpts {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
cp := config.ConfigParser{LineHandler: handle_line}
|
||||
_ = cp.ParseFiles(path)
|
||||
config.ReadKittyConfig(handle_line)
|
||||
return ans
|
||||
}
|
||||
|
||||
var RelevantKittyOpts = sync.OnceValue(func() KittyOpts {
|
||||
return read_relevant_kitty_opts(filepath.Join(utils.ConfigDir(), "kitty.conf"))
|
||||
return read_relevant_kitty_opts()
|
||||
})
|
||||
|
||||
func (self *Handler) handle_wheel_event(up bool) {
|
||||
|
||||
Reference in New Issue
Block a user