diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2023-03-25 10:23:05 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2023-03-25 10:41:19 +0900 |
commit | d7daf5f72411f29eca3ab398c7a8a951ca230cad (patch) | |
tree | 4ac325a32da748f3ecf447972726cafdf502a0bb /src/terminal.go | |
parent | e5103d94290eb9d65807a9f1ecee673bd9ce7cc2 (diff) |
Render CR and LF as ␍ and ␊
Close #2529
Diffstat (limited to 'src/terminal.go')
-rw-r--r-- | src/terminal.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/terminal.go b/src/terminal.go index dfc21a3b..5196d5cc 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -752,7 +752,7 @@ func (t *Terminal) ansiLabelPrinter(str string, color *tui.ColorPair, fill bool) // Simpler printer for strings without ANSI colors or tab characters if colors == nil && strings.IndexRune(str, '\t') < 0 { - length := runewidth.StringWidth(str) + length := util.StringWidth(str) if length == 0 { return nil, 0 } @@ -1415,7 +1415,7 @@ func (t *Terminal) printInfo() { pos = t.promptLen + t.queryLen[0] + t.queryLen[1] + 1 str := t.infoSep maxWidth := t.window.Width() - pos - width := runewidth.StringWidth(str) + width := util.StringWidth(str) if width > maxWidth { trimmed, _ := t.trimRight([]rune(str), maxWidth) str = string(trimmed) @@ -1950,7 +1950,7 @@ func (t *Terminal) processTabs(runes []rune, prefixWidth int) (string, int) { w = t.tabstop - l%t.tabstop strbuf.WriteString(strings.Repeat(" ", w)) } else { - w = runewidth.StringWidth(str) + w = util.StringWidth(str) strbuf.WriteString(str) } l += w |