You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Search for something, then remove a character and see spurious ; and other characters appear on lines. ctrl+L fixes it.
core problem is this:
import (
"fmt"
"github.com/mattn/go-runewidth"
)
func main() {
fmt.Println(runewidth.StringWidth("☺️"))
fmt.Println(runewidth.RuneWidth('☺')) // created from above but deleting the modifier
fmt.Println(runewidth.RuneWidth('️')) // created from first line, but backspacing the emoji char leaving the modifier
}
$ go run main.go
1
1
1
Fzf computes width of line using runewidth.Runewidth instead of runewidth.StringWidth. The second takes into account zero width emoji modifiers:
RuneWidth of just emoji = 1, RuneWidth of the modier= 1, so fzf thinks length is 2
However StringWidth of emoji+modifier = 1 (which is correct)
When computing number of spaces to pad with, fzf misses 1 (or more) and random characters appear.
The text was updated successfully, but these errors were encountered:
man fzf
)Relevant:
#1526
#2163
But different enough for its own issue.
Info
Problem / Steps to reproduce
Search for something, then remove a character and see spurious
;
and other characters appear on lines.ctrl+L
fixes it.core problem is this:
Fzf computes width of line using
runewidth.Runewidth
instead ofrunewidth.StringWidth
. The second takes into account zero width emoji modifiers:RuneWidth of just emoji = 1, RuneWidth of the modier= 1, so fzf thinks length is 2
However StringWidth of emoji+modifier = 1 (which is correct)
When computing number of spaces to pad with, fzf misses 1 (or more) and random characters appear.
The text was updated successfully, but these errors were encountered: