diff options
Diffstat (limited to 'ui/editor.go')
-rw-r--r-- | ui/editor.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/editor.go b/ui/editor.go index a714587..7e8c96e 100644 --- a/ui/editor.go +++ b/ui/editor.go @@ -37,11 +37,12 @@ type Editor struct { autoCacheIdx int } -func NewEditor(width int, autoComplete func(cursorIdx int, text []rune) []Completion) Editor { +// NewEditor returns a new Editor. +// Call Resize() once before using it. +func NewEditor(autoComplete func(cursorIdx int, text []rune) []Completion) Editor { return Editor{ text: [][]rune{{}}, textWidth: []int{0}, - width: width, autoComplete: autoComplete, } } |