add user defined options (#865)

This commit is contained in:
Christian Zangl authored and GitHub committed 2022-10-15 15:50:21 +03:00
1 parent 62621736b3
commit a2fed6d16e
6 files changed
+36 -1

No files matched your search

+6 -1
View File
@@ -442,7 +442,12 @@ func (e *setExpr) eval(app *app, args []string) {
gOpts.truncatechar = e.val
default:
app.ui.echoerrf("unknown option: %s", e.opt)
// any key with the prefix user_ is accepted as a user defined option
if strings.HasPrefix(e.opt, "user_") {
gOpts.user[e.opt[5:]] = e.val
} else {
app.ui.echoerrf("unknown option: %s", e.opt)
}
return
}
app.ui.loadFileInfo(app.nav)