Add support for displaying lf options in the ruler (#1257)

* Add support for displaying lf options in the ruler

* Print escape character as plain text

* Document user defined options

* Change escape rules

* Use reflect instead of environment table

* Factor out common option map logic

* Improve error message slightly

* Display blank option values
This commit is contained in:
Joe Lim authored and GitHub committed 2023-05-24 12:30:38 +03:00
1 parent 0ac1491bfb
commit e08eebb115
6 files changed
+54 -28

No files matched your search

+4 -2
View File
@@ -494,8 +494,10 @@ func (e *setExpr) eval(app *app, args []string) {
switch s {
case "df", "acc", "progress", "selection", "filter", "ind":
default:
app.ui.echoerr("ruler: should consist of 'df', 'acc', 'progress', 'selection', 'filter' or 'ind' separated with colon")
return
if !strings.HasPrefix(s, "lf_") {
app.ui.echoerr("ruler: should consist of 'df', 'acc', 'progress', 'selection', 'filter', 'ind' or 'lf_<option_name>' separated with colon")
return
}
}
}
gOpts.ruler = toks