Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export user-options on change #1418

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,10 @@ func (e *setExpr) eval(app *app, args []string) {
// 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
// Export user defined options immediately, so that the current values
// are available for some external previewer, which is started in a
// different thread and thus cannot export (as `setenv` is not thread-safe).
os.Setenv("lf_"+e.opt, e.val)
} else {
app.ui.echoerrf("unknown option: %s", e.opt)
}
Expand Down