From e28fe75522284410d918ca2cf3a555ecb8af8b07 Mon Sep 17 00:00:00 2001 From: denizul Date: Mon, 4 Jul 2022 15:45:26 -0400 Subject: [PATCH] Fixed: Autocomplete adds unwanted space (ASCII 32)(Issue #190) --- complete.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/complete.go b/complete.go index c08c994..de8d6fe 100644 --- a/complete.go +++ b/complete.go @@ -123,7 +123,9 @@ func (o *opCompleter) HandleCompleteSelect(r rune) bool { switch r { case CharEnter, CharCtrlJ: next = false - o.op.buf.WriteRunes(o.op.candidate[o.op.candidateChoise]) + target := o.op.candidate[o.op.candidateChoise] + target = target[:len(target)-1] + o.op.buf.WriteRunes() o.ExitCompleteMode(false) case CharLineStart: num := o.candidateChoise % o.candidateColNum