* Miscellaneous tweaks and fixes
Mostly these were found by running golangci-lint with a bunch of linters
(more than the default set) enabled.
* fmt.Fprint -> fmt.Fprintln where possible
* Remove "nolint:staticcheck" for now
* Initial commit
* Add documentation
* Fix nav volatile preview state
* Use `previewer` for both preloading and previewing
* Generate documentation
* Update `CHANGELOG.md`
* 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
- Refactor of the completion module, primarily to have the `match...` functions return the result for each possible match, so that they can be displayed when the user cycles through the completions using `cmd-menu-complete`/`cmd-menu-complete-back`
- Add support for completing list options (e.g. `set info user:group:size:time`)
- Provide different implementations for escaping/unescaping for `lfrc` command syntax, Unix and Windows. It is a bit hacky, but for now I want to keep `lf` as shell-agnostic as possible which means minimizing the logic based on `gOpts.shell`
- Fix alignment bug in the completion menu when displaying filenames with fullwidth characters
- Add functionality for visually selecting files
- Add keymap for Visual mode, and supporting `nmap` and `vmap` commands
- Add mode column for `maps` command, also add `nmaps` and `vmaps` commands
- Add `visualfmt` option for configuring appearance for the visual selection
- Add `%m/%M` placeholders for displaying the mode
- Add marker indicating the number of visually selected files in the ruler
- Add `visual` as an identifier when exporting `lf_mode`
- Remove experimental `invert-below` command
* Make sixel output flicker free
* Address pr comments
* Lock regions based on sixel dimensions
This fixes issues related to clearing the previous sixel data
* name changes and extra error handeling
* Apply force clearing changes and change log messages
* Delete missleading comment
* check pixel dimensions
* correct cell dimensions checking
* Add force clearing on image update
---------
Co-authored-by: Mariusz Kuchta <mariusz@kuchta.dev>
* Invalidate cache for recreated files
* Sanity check for file updates
* Prevent load when watching
* Revert "Prevent load when watching"
This reverts commit 4cf4629a87.
* Load is redundant when watch is enabled
* Add watch option
* Implement directory changes
* Implement file changes
* Fix for dircounts
* Remove test code
* fix dircounts
* Set watches on cd instead of select
* Set watches on startup too
* Watch newly created directories
* Add chmod events
* Avoid using multiple threads
Seems to cause issues if there are multiple threads and each one of them
is loading the same new file, in which case there is a race condition.
* Reduce logic when updating files
* Throttle write updates
* Use timer instead of ticker
* Fix file write out-of-band timing issue
* Fix cursor when renaming
* Prevent file showing at bottom during rename
* Watch new directory when created
* Revert "Watch new directory when created"
This reverts commit 6856804313.
* Reapply "Watch new directory when created"
This reverts commit 1c29f34981.
* Try batching renew updates
* Big rewrite
* Reload individual directories
* Change delay to 100 milliseconds
* Use separate goroutine for loading files/dirs
* Fix filter resetting
* Add documentation
* Use 32KB buffer for `copyFile()` (reduces copy time by 30%)
This makes `:paste` comparable in performance to `cp --reflink=never`
for large files.
For large number of small files improvements are less substantial
(compared to `cp -r --reflink=never`), though still noticeable.
In both cases the copy takes about 30% less time than with `buf` size at 4096.
32KB is the same number `io.Copy()` uses internally (when it can), and is about where improvements stop.
Context:
https://github.com/gokcehan/lf/issues/1685#issuecomment-2163934296
* Apply suggested changes
* Just delete incomplete an file on all errors
* Mention new progress UI update frequency
* Return the old (each 4MB copied) progress update frequency
(progress UI updates don't seem to impact performance much)