chore: remove go-runewidth as dependency (#2411)

* Add truncate functions

* Replace code for printing command line

* Replace code in truncateFilename function

* Remove restriction for truncatechar to be width 1

* Replace code in printdir function

* Replace code in listmatches

* Remove go-runewidth

* Revert truncatechar limitation change
This commit is contained in:
Joe Lim authored and GitHub committed 2026-03-04 19:32:46 +11:00
1 parent fd2babd72e
commit d082410b3d
6 files changed
+136 -188

No files matched your search

+2 -2
View File
@@ -15,6 +15,7 @@ import (
"unicode/utf8"
"github.com/gdamore/tcell/v3"
"github.com/rivo/uniseg"
)
func applyBoolOpt(opt *bool, e *setExpr) error {
@@ -416,11 +417,10 @@ func (e *setExpr) eval(app *app, _ []string) {
case "timefmt":
gOpts.timefmt = e.val
case "truncatechar":
if runeSliceWidth([]rune(e.val)) != 1 {
if uniseg.StringWidth(e.val) != 1 {
app.ui.echoerr("truncatechar: value should be a single character")
return
}
gOpts.truncatechar = e.val
case "truncatepct":
n, err := strconv.Atoi(e.val)