* Create CI job to run `gen/xbuild.sh`, adjust `xbuild.sh` to make it possible
This reworks the gen/xbuild.sh script to exit with a failure if any of the targets don't compile. It also adds a CI job to try cross-compiling for every platform on every pull request.
The new check is a little slow and compute-expensive, but I am hoping it's well within the quota.
See #1299 for a demo of how the CI would have failed after #1288 and before #1295.
Screenshot: https://github.com/gokcehan/lf/assets/4123047/3d7a6b7c-8642-4d4c-a98a-c8b886c0b184
Thanks to @joelim-work for numerous improvements and an alternate
implementation I heavily borrowed from
(https://github.com/joelim-work/lf/blob/ci/gen/xbuild.sh)
* Refactor xbuild.sh some more to decrease repetition
I can remove this commit if people prefer.
* Generate darwin-arm64 binaries as we have users using it
Arm Macs are becoming popular. We have at least one
user: https://github.com/gokcehan/lf/issues/1294. It
seems lf works fine there.
* allow flexible truncation of filenames
As of now, lf truncates always at the end. So for long filenames one can
not see the end (especially not the file ending, like .jpeg or .pdf).
[MidnightCommander](https://github.com/MidnightCommander/mc/) truncates
too long filenames in the middle, so it's possible to see the beginning
and the end of the too long filename.
This commit allows to specify a flexible point for the truncation in
percent of the available space.
* The default value of 100 for the new `truncatepct` option means no
change in lf behaviour.
* More adhering to naming convention.
* Improve error message for invalid `truncatepct` values.
* Remove redundant test cases.
* FIXUP Add dummy empty line to make `go fmt` happy.
* Avoid explicit "cast" to rune array.
* fix(doc.go): remove line with single dot
This was there to avoid that `go fmt` touches the next item with `waitmsg`.
However, removing the spaces before the example list items has the same
effect.
* Add `fileinfofmt` option
* echof is now unused
* Use different default for Windows
* Add new line to docs
* Indent placeholders description in documentation
* Change option name to `statfmt`
* Use plain text format for documentation
This is a natural complement to the recently introduces `maps` and `cmaps`.
I considered using a different output format, since `cmd` definitions can be
long, but I decided against it for now. `lf` already abbreviates commands that
take up several lines, and we can change the output format later if needed.
* 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
* make it possible to preserve mtime and atime when copying files
Preserving other attributes like ownership, ctime or btime of a file is
desired but currently not possible to implement in a portable way with go.
Fixes#869
Relates to #779
* FIXUP use cp-compatible default for not-preserving mode
* Refactor piping to pager: extract to separate function, simplify invocation
This is meant to be straightforward and clearly a no-op,\
at the cost of being a bit verbose.
* Refactor: reduce duplication between sync shell commands and pager
* Refactor: minor cleanup of async shell functions
After the previous refactors, the logic for async shell commands can
be simplified somewhat. There is likely room for further improvements,
but that is beyond the scope of this PR.
* Remove duplicated shellSetPG invocation
See https://github.com/gokcehan/lf/pull/1243#discussion_r1193078282
* Support modifiers in mappings
* Update docs
* Support cmap keybindings as well
* Implement push
* Move order of escape key check
* Add safety check
* Fix safety check
* Factor out common logic
* Make `:maps` work on Windows
This makes the `:maps` command from #1146 work on Windows.
This (as well as `:maps` itself) is based on @jackielli's work in #1146 and
#1152.
I intend to refactor the code in this or a separate PR, but I thought I'd
submit the critical and simple bit first.
* Add `:cmaps` command
After the naming scheme from #1146, it would seem weird to not have a :cmaps
command. This could help with issues like #876.