-
Notifications
You must be signed in to change notification settings - Fork 329
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
invert-below
command to substitute for visual mode
#1101
Conversation
How about instead of doing this you use logic to select all between nearest selected and current focused file? That would work in both directions. Also that could allow to make commands like jump n items up or down and focus in between. The use case from this PR could be covered by selecting starting point, jumping to bottom and focus all in between. |
It would bother me that if I'm between two selections, I would have to count which is closer.
It's true that repeating Aside: I also tried creating a command with |
That sounds like a edge-case that could be handled by always using the above file as starting point This was just an idea that sounded better to me but I cannot speak about implementation so I am fine with this too. |
I don't mean that it's difficult to implement. I mean that, as a user, if I'm between two selections, I'd have to either guess or count to know which way it would go. |
I think only checking first and last is enough. If current focus is above first selection, select in between and same for the last selection and focus below. If focus is in between always focus all between first above item selected and focus or refuse action |
I think it's much simpler to have It's true that sometimes a solution with edge cases is necessary, but it would need to have some great advantage over a simpler solution to be worth it. |
The behavior I explained would be consistent if implemented like that. Like I said I think this addition is good and I just thought that it looked too much like flipping the bits until you get desired selections instead of doing what sounded more intuitive to me. Thank you for your time |
"invert below" is such a hard to explain concept. While I see how it could be useful (after reading the linked comments) I don't think it is very intuitive. Please don't map it by default. |
I've been a bit quiet here since I don't have much to add, but maybe I'll write down where I'm at. @laktak, I'm not convinced -- I think having this feature and mapping this to I am not particularly certain of my opinion, however. If the consensus and/or @gokcehan's opinion is not to merge this, or to merge it without a binding, that's OK with me. Most importantly, I haven't thought of a way to make it better or more intuitive than it already is without much larger changes to lf. Update: I thought I'd ask in the linked bug whether people who've been wanting visual selection find this useful or not. |
I did think of another design, see #477 (comment). However, I'm not sure how interested I am in implementing it, since this PR is good enough for me. Anybody is welcome to it, if they are interested. I would appreciate a warning so that I don't start implementing it when somebody else already started on it. |
@ilyagr Thanks for working on this. Last time I checked this PR, I decided to leave it open for more discussion as I didn't have much to say. While I appreciate the simplicity of this approach, I also agree with @DusanLesan and @laktak that this is kind of an alien concept that we don't see anywhere else. The closest thing I can think of is the shift clicking to select all files in between in regular gui file managers. Anchoring approach you mention in the linked issue sounds like the keyboard adaptation of that behavior. Since I can't really ask you implement it, we shall better leave that work for later. |
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 gokcehan#477 (comment). Fixes gokcehan#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.
OK, I removed the binding. I also mentioned that the command is experimental in the docs. Thanks for the review! |
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
#477 (comment).
Since
invert
is bound tov
by default,. Update: There is no longer a default binding, you will have to add something along the lines ofinvert-below
getsV
as a default bindingmap V invert-below
tolfrc
yourself.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
.