Add check for truncatechar (#420)
* Add check for truncatechar When value is longer than 1 character, it throws an error * Use runeSliceWidth instead of len
This commit is contained in:
1 parent
d0cd181eb6
commit
3b49e1a2b6
1 file changed
+5
@@ -315,6 +315,11 @@ func (e *setExpr) eval(app *app, args []string) {
|
||||
case "timefmt":
|
||||
gOpts.timefmt = e.val
|
||||
case "truncatechar":
|
||||
if runeSliceWidth([]rune(e.val)) > 1 {
|
||||
app.ui.echoerr("truncatechar: value should be 1 character long")
|
||||
return
|
||||
}
|
||||
|
||||
gOpts.truncatechar = e.val
|
||||
default:
|
||||
app.ui.echoerrf("unknown option: %s", e.opt)
|
||||
|
||||
Reference in new issue
Block a user