survey icon indicating copy to clipboard operation
survey copied to clipboard

Support flexible SelectFocus text width

Open catc opened this issue 3 years ago • 1 comments

Allow for icons.SelectFocus.Text to have a length > 1 and still align options correctly.

For example:

func setIcons(icons *survey.IconSet) {
	icons.SelectFocus.Text = "🌿"
}

results in misaligned select options:

Screen Shot 2020-10-04 at 5 03 28 PM

This might be a little more difficult for emojis (in my case, 🌿 is 4 bytes but has a width of 2 in the terminal) - https://github.com/rivo/uniseg might come in useful.

catc avatar Oct 04 '20 21:10 catc

Thanks for reporting this @catc!

AlecAivazis avatar Oct 05 '20 18:10 AlecAivazis