From 1fef36e4bcafa6c785c78fe9d9cdaf2f7e58701b Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 25 May 2024 16:31:34 +0900 Subject: [PATCH] Do not allow tabs in pointer and marker --- src/terminal.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/terminal.go b/src/terminal.go index 9a4e8b8..e2ea49f 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -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)