Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When clicking on file preview, only open files on right-click (+ doc fix) #975

Merged
merged 2 commits into from
Nov 13, 2022

Conversation

ilyagr
Copy link
Collaborator

@ilyagr ilyagr commented Oct 23, 2022

After #963, when the mouse is on, I often click on the preview accidentally since it's such a large target, which takes me to another program. Moreover, if the terminal with lf isn't focused and a file is previewed, there is very little space where I can click without having the state change drastically (clicking the preview is out, clicking almost anywhere else changes the preview).

This commit fixes the issue, at the cost of the ability to open files with the mouse becoming slightly harder to discover.

I hope you're OK with this, @p-ouellette. An alternative I considered would be to create a special command preview-left-click that could default to something like :echo Right-click to open file but could be changed to open (or vice versa), but I'm not sure that's worth it.

P.S. I also included a separate minor fix to the docs related to #718. I can extract that to a separate PR; if another of my PRs is likely to go in earlier, I'll probably move it there.

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.
Currently, the example fails confusingly for newer versions
of `tput`. See gokcehan#718.
@ilyagr ilyagr changed the title When clicking on file preview, only open files on right-click When clicking on file preview, only open files on right-click (+ doc fix) Oct 23, 2022
@p-ouellette
Copy link
Contributor

Fine by me. Works the same in ranger.

@gokcehan gokcehan merged commit 48d1899 into gokcehan:master Nov 13, 2022
gokcehan added a commit that referenced this pull request Nov 13, 2022
@gokcehan
Copy link
Owner

@ilyagr Issue link in the example was bugging me so I have now added env variables to be used in % commands and updated the example accordingly.

@ilyagr ilyagr deleted the preview-click branch December 22, 2022 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants