Commit Graph
1405 Commits
Author SHA1 Message Date
rrveexandrr 122dee1f45 Enhance rename prompt (#1162)
* enhance rename ui

* gofmt

* default rename: cursor on dot

* fix basename length

* fix basename length... again

---------

Co-authored-by: rr <rr@arveex.eu>
2023-03-20 20:11:23 +03:00
Joe Lim 8652707299 Avoid refreshing previews for async shell commands (#1164) 2023-03-20 19:59:39 +03:00
Gokcehan 41cdd02572 update doc
cc #758
2023-03-16 18:11:29 +03:00
Gokcehan 207de6a506 add errors for unexpected boolean option values
cc #758
2023-03-16 17:51:59 +03:00
Gokcehan acb5693b11 cleanup 2023-03-16 17:35:56 +03:00
Gokcehan 85512625f8 add 'true/false' syntax for boolean options
cc #758
2023-03-16 17:24:41 +03:00
Joe Lim 0bf17dd3f0 Fix width used for line numbers (#1151) 2023-03-12 15:35:23 +03:00
Joe Lim db9de4d4de Refactor code for printing directories (#1150) 2023-03-12 15:34:44 +03:00
Joe Lim 9440b1b319 Update file info after reload command (#1149)
* Update status bar after reload

* Add comment
2023-03-12 15:30:16 +03:00
Jackie Li a85ce898a1 try to fix #916 (#1146) 2023-03-12 15:24:44 +03:00
Joe Lim 9f1428582f Remove commented code (#1141) 2023-03-12 15:11:25 +03:00
Joe Lim bcd058ace2 Delete stale dircache entry during rename (#1138)
* Delete stale dircache entry during rename

* Clear `regCache` as well

* Add comment
2023-03-12 15:11:09 +03:00
dependabot[bot] 382534c4ba Bump golang.org/x/term from 0.5.0 to 0.6.0 (#1137)
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/term/releases)
- [Commits](https://github.com/golang/term/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-12 15:07:28 +03:00
dependabot[bot] c2cbc39ce5 Bump golang.org/x/sys from 0.5.0 to 0.6.0 (#1136)
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.5.0 to 0.6.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.5.0...v0.6.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-03-12 15:04:23 +03:00
István Donkó a8e95ae40a Replace the obsolete Vue icon in the example file (#1123) 2023-03-12 15:04:07 +03:00
dependabot[bot] 3fc1db5d14 Bump github.com/gdamore/tcell/v2 (#1128)
Bumps [github.com/gdamore/tcell/v2](https://github.com/gdamore/tcell) from 2.5.4-0.20221019011350-d3cbfcfb7aa3 to 2.6.0.
- [Release notes](https://github.com/gdamore/tcell/releases)
- [Commits](https://github.com/gdamore/tcell/commits/v2.6.0)

---
updated-dependencies:
- dependency-name: github.com/gdamore/tcell/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-26 01:04:32 +03:00
Ilya Grigoriev 7a7e81e88c Update the Go version in go.mod to 1.18 (#1132)
* Replace functions from `ioutil` with same functions from `io`

This is demanded by staticcheck if we upgrade the go version in go.mod.

* Replace ioutil.ReadDir with os.ReadDir

* Update Go version to 1.18 in go.mod

This requires abandoning use of the `ioutil` module (see parent commits)
to pass `staticcheck`.
2023-02-26 01:01:04 +03:00
Ilya Grigoriev b02fd42df4 invert-below command to substitute for visual mode (#1101)
This command inverts the selection for the current file and all the files below
it. Using this command twice substitutes for having a "visual" mode. This is
described in more detail in the docs and in
https://github.com/gokcehan/lf/issues/477#issuecomment-1414563834.

Fixes #477. While that's not exactly what was asked for, I hope it's a suitable
replacement and seems more in the spirit of `lf`, at least until a better
replacement is implemented.
2023-02-26 01:00:54 +03:00
Gokcehan 752f059068 remove older than go1.17 instructions from readme 2023-02-25 23:25:52 +03:00
Gokcehan 326930f46f change go version from 1.17 to 1.18 2023-02-25 23:19:07 +03:00
dependabot[bot] 6c3366eec4 Bump actions/checkout from 2 to 3 (#1129)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-25 23:12:56 +03:00
dependabot[bot] 28936c7506 Bump dominikh/staticcheck-action from 1.2.0 to 1.3.0 (#1127)
Bumps [dominikh/staticcheck-action](https://github.com/dominikh/staticcheck-action) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/dominikh/staticcheck-action/releases)
- [Changelog](https://github.com/dominikh/staticcheck-action/blob/master/CHANGES.md)
- [Commits](https://github.com/dominikh/staticcheck-action/compare/v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: dominikh/staticcheck-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-25 23:12:18 +03:00
dependabot[bot] 960f23c288 Bump actions/setup-go from 2 to 3 (#1126)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-25 23:10:47 +03:00
sitiom 95a6f9584f Add Winget Releaser workflow (#1107)
* Add Winget Releaser workflow

* Add dependabot

* Update release.yml
2023-02-25 23:01:00 +03:00
David Pedersen cae576bb1d Navigate cmd history with up/down (#1112) 2023-02-25 20:41:32 +03:00
Ilya Grigoriev 6afefa5d09 Option to change look of cursors in parent dirs, rename an option. (#1106)
* Add `cursorparentfmt` option for cursors in parent dirs

The option defaults to the same value as `cursorfmt`, so the default look of `lf` is unchanged. However, I find it useful to make it different, since I seem to have so much trouble figuring out which of my cursors is the active one. :)

For example, here's what it looks like if one has `set cursorparentfmt "\033[7;90m"` in their `lfrc`:

https://user-images.githubusercontent.com/4123047/218299130-09ac411f-307a-489e-a4f0-4691710f8549.png

* Remove `cursorfmt` option to `cursoractivefmt`

This seems appropriate after introducing `cursorparentfmt`
2023-02-25 20:38:41 +03:00
Joe Lim c0c85f206f Fix documentation for dironly/dirpreviews options (#1105) 2023-02-12 14:38:58 +03:00
Ilya Grigoriev 530ab2c40a Allow separate styles for cursor in normal and preview panes, simplify tagfmt and errorfmt (#1086)
* Allow separate styles for cursor in normal and preview panes

This defines new `cursorfmt` and `crusorpreviewfmt` options to style cursor in normal/preview panes. This allows using a different style for the normal and preview cursor. The documentation includes several possible values these options can be set to.

The default behavior is an underline, same as in
https://github.com/gokcehan/lf/pull/1072, since it should not cause severe
problems and be visible on all terminals. It can now be easily changed, as explained in the docs. I also added an example to `etc/lfrc.example`.

See linked issues and PRs for the more context.

Fixes https://github.com/gokcehan/lf/issues/1038

Follows up on:

https://github.com/gokcehan/lf/pull/1072
https://github.com/gokcehan/lf/pull/924
https://github.com/gokcehan/lf/commit/b47cf6d5a5

* Simplify configuration of several formatting options

This simplifies the configuration of `cursorfmt`, `cursorpreviewfmt`, `tagfmt`,
and `errorfmt` options.

In almost all usecases, the value of these options had to end with `%s\033[0m`
to print the contents of filename/tag/error and reset the terminal style. Now,
if `%s` is not part of the option's value, `%s\033[0m` is appended
automatically. This simplifies configuration.

I retained the same behavior as before when `%s` is part of the string for
backwards compatibility. I think it should be considered deprecated, but it
also causes no harm.
2023-02-11 20:11:07 +03:00
Joe Lim 4a443cae58 Refresh preview even if selection doesn't change (#1074) 2023-02-11 20:01:46 +03:00
valoq 0b99aaed4e Add example to hiddenfiles documentation (#1073)
* Improve documentation

* fix missing quote

* update manpage
2023-02-11 20:01:20 +03:00
Ilya Grigoriev 6440281e82 Disallow exiting from rename: mode with backspace (#1060)
After looking at the list of possibilities for `app.ui.cmdPrefix` by searching
through the code, renaming looks to be the only remaining mode where exiting
via backspace doesn't make sense.

In particular, I don't think any commands other than `rename` commonly start
out with some editable text in the prompt. The other dangerous mode is the `>`
mode, but there exit-on-backspace was already disabled.

Fixes #1052, #1059
2023-02-11 20:00:08 +03:00
Ilya Grigoriev 2fe5e4d54e Bind Ctrl+MouseWheel to scroll up/down (#1051)
On my system, Shift+Mouse is captured by the terminal and
Alt+Mouse only works for one of the alt keys. Hence I picked
Ctrl.

This also allows binding of Ctrl+MouseButtons (but doesn't set
any such bindings). 

As a minor bonus, that should allow using Ctrl+Click to select
`lf`'s terminal without moving the cursor no matter where you
click.  On tmux, this doesn't work out of the box and requires
a change to `tmux.conf` along the following lines:

     bind-key -T root  C-MouseDown1Pane  select-pane -t = \; send-keys -M

You can omit the `send-keys -M` if you never want to pass
`Ctrl+Click` to any of your terminal apps. (Then it will work
without this PR).
2023-02-11 19:58:44 +03:00
Ilya Grigoriev a4fa5d36c9 Make lfcd examples safer for people who alias lf to lfcd (#1049)
People keep running into an infinite loop and being confused.
See https://github.com/gokcehan/lf/issues/140#issuecomment-1256368250
and https://github.com/gokcehan/lf/discussions/1043.

This fixes the issues in `lfcd.sh` and `lfcd.fish`. For the other
scripts, I'm not sure whether this issue exists or is fixable.

One of the discussions above also suggested the need to document
the key binding better.
2023-02-11 19:55:49 +03:00
Gokcehan b47cf6d5a5 revert dim colors for previews
cc #924 #1038
r28
2022-12-24 23:15:46 +03:00
Penn Bauman aa78b26e44 updated gopkg.in/djherbis/times.v1 v1.2.0 to github.com/djherbis/times v1.5.0 (#1017) 2022-11-28 19:16:15 +03:00
Gokcehan 4440a15a8c add the current example open command to the doc
cc #991
2022-11-15 21:26:30 +03:00
devnull09 887748cefd Avoids flicker during open (#991)
* Avoids flicker during open

* Update lfrc.example

remove setsid after we execute is with open &{{ anyway
2022-11-15 21:07:30 +03:00
Gokcehan c1bcf71ece export lf_width and lf_height as env variables
cc #718 #975
2022-11-13 23:00:13 +03:00
valoq 459608e096 load file info after init (#994)
* load fileinfo after init

* do not overwrite error message if present
2022-11-13 17:20:27 +03:00
maidlover 9bb2487b14 Fix toggling of directory previews (#993)
* Fix toggling of directory previews

* Fix "dirpreviews!"

* Sort tab completion items consistently
2022-11-13 17:20:01 +03:00
Ilya Grigoriev 48d1899ec8 When clicking on file preview, only open files on right-click (+ doc fix) (#975)
* When clicking on file preview, only open files on right-click

Currently, when mouse is on, I often click on the preview accidentally
since it's such a large target. Moreover, there is very little space I
can click without having the `lf` state change drastically (since I must
click on the current file for the preview to stay the same).

This commit prevents that.

* (Minor): Change example in docs to work around a bug

Currently, the example fails confusingly for newer versions
of `tput`. See https://github.com/gokcehan/lf/issues/718.
2022-11-13 16:54:54 +03:00
Paul Ouellette a94015d221 Add mouse support for selecting and opening files (#963)
* Add mouse support for selecting and opening files

Left click to select, right click to open, similar to ranger.
Closes #919.

* Add default mouse wheel mappings

* Update tcell to d3cbfcf

Commit d3cbfcf fixes a bug where mouse wheel events were misdelivered as
button events.
2022-10-19 18:57:44 +03:00
Gaétan Lepage 8e919b8268 Fix user query when using libc implementation of os/user (#972) 2022-10-19 18:56:04 +03:00
Ilya Grigoriev e4fa885d26 Remove accidentally commited empty file (#970) 2022-10-18 15:34:18 +03:00
Ilya Grigoriev 624992ad7b Add staticcheck and go-generate Github check (#968)
* Fix Staticcheck errors & minor logic simplification

Simplify logic in ui.go. In that diff, `st` would already have the
Reversed flag set; there's no need to set it again.

Also, minor changes to remove all the statickcheck errors VS code's
Go extension complains about.

* Add staticcheck and Go 1.19 go-generate Github check

This adds a few Github action checks:

1. Check that `go fmt` and `go generate` were run on Go 1.19, following
up on https://github.com/gokcehan/lf/commit/654b8737b8a35729aa89aa93acf05ed5871b2616.
On earlier Go versions, `go generate` results in whitespace changes.

2. Check that [Staticcheck](https://staticcheck.io/) passes.
2022-10-16 18:54:34 +03:00
Ilya Grigoriev 04d40832f1 For directories in preview column, dim cursor (#924)
* For directories in preview column, dim cursor

When preview is on and consists of a directory listing, make the
cursor in there dimmer to emphasize it's not active. This makes it
visually obvious which cursor is active at all times, without
having to read the path. The active cursor is now always  the
rightmost bright one, regardless of whether the `preview` option
is on or off.

See screenshots in the pull request at
https://github.com/gokcehan/lf/pull/924.

Before this, I noticed that I often open a file by accident because
I got confused which of the three cursors on the screen is the active
one.

* No-op changes to ui.go

Reduce number of arguments to printDir and list non-configurable colors
2022-10-16 18:51:26 +03:00
Ilya Grigoriev f1312ca969 Fix Staticcheck errors & minor logic simplification (#967)
Simplify logic in ui.go. In that diff, `st` would already have the
Reversed flag set; there's no need to set it again.

Also, minor changes to remove all the statickcheck errors VS code's
Go extension complains about.
2022-10-16 18:50:41 +03:00
Ilya Grigoriev e570d5f65b Document mode-switching between : and !/$/%/& command-line modes (#966)
Documents #960, also known as
https://github.com/gokcehan/lf/pull/960/commits/52a151aba22f745e045427bf6c45511325abc6fa
2022-10-16 18:46:43 +03:00
Gokcehan 654b8737b8 update man generator for go1.19
cc #959 #961
2022-10-15 21:34:55 +03:00
Christian Zangl e10ef9111b add an on-select command (#864) 2022-10-15 21:06:09 +03:00