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.
This commit is contained in:
Ilya Grigoriev authored and GitHub committed 2022-11-13 16:54:54 +03:00
1 parent a94015d221
commit 48d1899ec8
4 files changed
+15 -9

No files matched your search

+3
View File
@@ -1209,6 +1209,9 @@ func (ui *ui) readNormalEvent(ev tcell.Event, nav *nav) expr {
if err != nil {
return nil
} else if !curr.IsDir() || gOpts.dirpreviews {
if tev.Buttons() != tcell.Button2 {
return nil
}
return &callExpr{"open", nil, 1}
}
dir = ui.dirPrev