From bc5e38790401d0bd69ffb858eb368eb8661c8c34 Mon Sep 17 00:00:00 2001 From: Ben Browning Date: Wed, 28 Sep 2016 21:01:11 -0400 Subject: [PATCH] Fix column padding calculation to prevent wrapping (#83) The calculation to determine how many spaces to use when padding columns wasn't taking into account the length of the 'same' portion of the completions and was only using the length of the completion itself. This frequently caused the printed completions to wrap, making the completion list much harder to read. --- complete.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/complete.go b/complete.go index 75b38af..349fc3d 100644 --- a/complete.go +++ b/complete.go @@ -219,7 +219,7 @@ func (o *opCompleter) CompleteRefresh() { } buf.WriteString(string(same)) buf.WriteString(string(c)) - buf.Write(bytes.Repeat([]byte(" "), colWidth-len(c))) + buf.Write(bytes.Repeat([]byte(" "), colWidth-len(c)-len(same))) if inSelect { buf.WriteString("\033[0m")