Change mattn/go-runewidth dependency to rivo/uniseg for accurate results

Related #3588 #3588 #3567
This commit is contained in:
Junegunn Choi
2024-01-21 02:52:28 +09:00
parent 66546208b2
commit 16f6473938
11 changed files with 59 additions and 51 deletions

View File

@@ -17,8 +17,7 @@ import (
"syscall"
"time"
"github.com/junegunn/go-runewidth"
"github.com/rivo/uniseg"
"github.com/junegunn/uniseg"
"github.com/junegunn/fzf/src/tui"
"github.com/junegunn/fzf/src/util"
@@ -798,7 +797,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox) *Terminal {
t.separator, t.separatorLen = t.ansiLabelPrinter(bar, &tui.ColSeparator, true)
}
if t.unicode {
t.borderWidth = runewidth.RuneWidth('│')
t.borderWidth = uniseg.StringWidth("│")
}
if opts.Scrollbar == nil {
if t.unicode && t.borderWidth == 1 {