Do not allow tabs in pointer and marker

This commit is contained in:
Junegunn Choi 2024-05-25 16:31:34 +09:00
parent 89375005b5
commit 1fef36e4bc
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -751,6 +751,10 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
hscroll: opts.Hscroll,
hscrollOff: opts.HscrollOff,
scrollOff: opts.ScrollOff,
pointer: *opts.Pointer,
pointerLen: uniseg.StringWidth(*opts.Pointer),
marker: *opts.Marker,
markerLen: uniseg.StringWidth(*opts.Marker),
wordRubout: wordRubout,
wordNext: wordNext,
cx: len(input),
@ -833,8 +837,6 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
lastAction: actStart,
lastFocus: minItem.Index()}
t.prompt, t.promptLen = t.parsePrompt(opts.Prompt)
t.pointer, t.pointerLen = t.processTabs([]rune(*opts.Pointer), 0)
t.marker, t.markerLen = t.processTabs([]rune(*opts.Marker), 0)
// Pre-calculated empty pointer and marker signs
t.pointerEmpty = strings.Repeat(" ", t.pointerLen)
t.markerEmpty = strings.Repeat(" ", t.markerLen)