summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-07-03 10:11:12 -0500
committerRobin Jarry <robin@jarry.cc>2022-07-03 21:32:18 +0200
commitd45c07eb6a0955a24efec7bd915ba19746042778 (patch)
treedc8fdd2ad6e7a99a9af458235bffc3071254fdfa /lib
parent12e8217d1fa0f4c4c83eebcc7473ecb8f0c072ba (diff)
downloadaerc-d45c07eb6a0955a24efec7bd915ba19746042778.zip
uiconfig: use pointer references to uiConfig
This patch changes references to uiConfig in function signatures and structs to be pointers. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib')
-rw-r--r--lib/ui/borders.go4
-rw-r--r--lib/ui/textinput.go6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/ui/borders.go b/lib/ui/borders.go
index 886a171..6a5e9dc 100644
--- a/lib/ui/borders.go
+++ b/lib/ui/borders.go
@@ -18,11 +18,11 @@ type Bordered struct {
borders uint
content Drawable
onInvalidate func(d Drawable)
- uiConfig config.UIConfig
+ uiConfig *config.UIConfig
}
func NewBordered(
- content Drawable, borders uint, uiConfig config.UIConfig) *Bordered {
+ content Drawable, borders uint, uiConfig *config.UIConfig) *Bordered {
b := &Bordered{
borders: borders,
content: content,
diff --git a/lib/ui/textinput.go b/lib/ui/textinput.go
index 0a331dc..8bc32b0 100644
--- a/lib/ui/textinput.go
+++ b/lib/ui/textinput.go
@@ -33,13 +33,13 @@ type TextInput struct {
completeIndex int
completeDelay time.Duration
completeDebouncer *time.Timer
- uiConfig config.UIConfig
+ uiConfig *config.UIConfig
}
// Creates a new TextInput. TextInputs will render a "textbox" in the entire
// context they're given, and process keypresses to build a string from user
// input.
-func NewTextInput(text string, ui config.UIConfig) *TextInput {
+func NewTextInput(text string, ui *config.UIConfig) *TextInput {
return &TextInput{
cells: -1,
text: []rune(text),
@@ -383,7 +383,7 @@ type completions struct {
onSelect func(int)
onExec func()
onStem func(string)
- uiConfig config.UIConfig
+ uiConfig *config.UIConfig
}
func maxLen(ss []string) int {