-
Notifications
You must be signed in to change notification settings - Fork 720
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
x
selects the next line when on an empty line
#2206
Comments
map global normal x <a-x> |
Good workaround for now, but I would still argue that both |
An empty line is nothing but a new line character, so when pressing x on it, it moves to the next line – the line being fully selected. The same goes for X.
There are corner cases where the commands don’t select the full line and move or extend. |
I see your point and the reasoning behind the current behavior, but I still think we should improve it 🙂 A new line character is still a character, so when pressing So I would say, the expected behavior is:
Also, currently |
I think this is a pretty good tradeoff between ease of use, simplicity and predictibility. I am dubious we can find a better one. |
I think I understood my own confusion... Contrary to vim where selection starts only when you switch to a visual mode, in kakoune we are always in a visual mode. Having a cursor always means something in selected. So in case of cursor standing on an empty line, the newline symbol (under cursor) is a selection, and since there are no more characters on the line, this entire line is literally being selected right now. From this perspective, what I described as "expected behavior" is also the actual behavior that happens today: With this in mind, I personally think nothing should change in kakoune and this issue should be closed. It's just a mind shift that needs to happen, remember that we are always in visual mode. |
@mawww As a side note, X doesn’t select the full line when selections are left oriented. |
@alexherbo2 Yep, extending has a simple behaviour, it keeps the anchor in place, which gives this behaviour if the line selection is inverted. |
x selects the next line when on an empty line, which means that in order to know how to delete a line I need to know if that line has spaces or not. If it has spaces I have to press xd but if it does not have spaces I would have to press only d because x on a blank line selects the next line.
This seems to make the behavior of x unpredictable and harder to use. Is this intentional? I'd prefer if x always selected the line that the cursor was on, even if that line was empty.
The text was updated successfully, but these errors were encountered: