briandowns/spinner

An extra space character added to the spinner line

Closed this issue · 4 comments

See this screenshot:

image

In this example, I set:

s.Prefix = "[ "
s.Suffix = " ] message..."

however, I still get an empty space after message... and before the cursor indicator of my terminal emulator.

It seems like there's an extra space somewhere in the code.

Seems to be by design (as it's very apparent in the code), but I'm not sure why.

outPlain := fmt.Sprintf("%s%s%s ", s.Prefix, s.chars[i], s.Suffix)

It's been a number of years since that line was written and I can't honestly remember. I think it had something to do with the multibyte chars of some of the spinners overlapping the adjacent text.

I think this was also due to not having the "hide cursor" feature as well. I'll push up a change that will remove the extra space.

Space removed on master branch.