Skip to content

Commit

Permalink
Make the :doc command work even if lf is not in the PATH
Browse files Browse the repository at this point in the history
Previously, `:doc` executed `lf -doc`. Now, it executed `$lf -doc` or `%lf%
-doc`.

Before this change, `:doc` did not work if `lf` is not in the PATH. This is
likely to happen to new users who are trying out `lf` and need docs the most.

Moreover, if you made some changes to the docs and ran `lf` with `go run .`,
`:doc` would return the docs for the version of `lf` in the PATH instead of
what is expected.
  • Loading branch information
ilyagr committed Apr 1, 2023
1 parent 1845c15 commit 7710610
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion os.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func setDefaults() {
gOpts.keys["i"] = &execExpr{"$", `$PAGER "$f"`}
gOpts.keys["w"] = &execExpr{"$", "$SHELL"}

gOpts.cmds["doc"] = &execExpr{"$", "lf -doc | $PAGER"}
gOpts.cmds["doc"] = &execExpr{"$", `"$lf" -doc | $PAGER`}
gOpts.keys["<f-1>"] = &callExpr{"doc", nil, 1}
}

Expand Down
2 changes: 1 addition & 1 deletion os_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func setDefaults() {
gOpts.keys["i"] = &execExpr{"!", "%PAGER% %f%"}
gOpts.keys["w"] = &execExpr{"$", "%SHELL%"}

gOpts.cmds["doc"] = &execExpr{"!", "lf -doc | %PAGER%"}
gOpts.cmds["doc"] = &execExpr{"!", "%lf% -doc | %PAGER%"}
gOpts.keys["<f-1>"] = &callExpr{"doc", nil, 1}
}

Expand Down

0 comments on commit 7710610

Please sign in to comment.