* Initial commit
* Add documentation
* Fix nav volatile preview state
* Use `previewer` for both preloading and previewing
* Generate documentation
* Update `CHANGELOG.md`
* Add ruler file for customizing the ruler
* Update `CHANGELOG.md`
* Show ruler errors instead of logging them
* Allow multiple sections
* Show syntax errors for ruler file
* Add line percentage
* Add lower/upper functions
* Add back truncation
* Use fmt options
---------
Co-authored-by: CatsDeservePets <145048791+CatsDeservePets@users.noreply.github.com>
* shell-pipe: fix excessive waiting for output
There are some programs that keep their stdin/stdout/stderr open beyond
their process lifetime. An example is "wl-copy", which forks off into
the background and keeps stderr open.
Before this change, the behaviour of lf's shell-pipe (aka %) was to
first wait for an EOF from the stdout/stderr pipe of the process, and
only then to wait for the process to exit.
As a result, a command such as "%wl-copy foo" never stops showing the
">" command prefix indicator.
Fix this, by waiting for the EOF from the pipe and the process exit in
parallel, as well as setting the "exec.Cmd.WaitDelay" field.
(For some reason, the fix works even without setting WaitDelay, and it
also doesn't seem to wait for one second; I haven't investigated why
this is; the behaviour is an improvement either way.)
Additionally, improve handling errors when reading from the
stdout/stderr pipe:
- Always give up reading from the pipe, regardless of error kind
- Unless it is an expected error (EOF or (now) ErrClosed), log the error
- Compare errors using "errors.Is"
* shell-pipe: use os.Pipe not Cmd.StdoutPipe etc.
The source-code comment explains why.
Also remove WaitDelay, which wasn't working, and which we probably don't
want anyway; and fix some insufficient error handling (missing return).
* Remove unnecessary space in history file
* Refactor history navigation
* Implement smarter history navigation
* Skip duplicate commands in history navigation
* Return to Normal mode if it started from there
* Reset history state when changing prompt
* Update documentation
I noticed that running ":maps" in lf on Linux uses a whole CPU. I
managed to track it down to a bug in the Go standard library, for which
I entered https://github.com/golang/go/issues/75304.
Until that is fixed, it seems worth having a workaround for this.