-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Swapping lines creates new empty lines #3602
Comments
The current behavior makes sense if you think of the newline characters as being part of the line 1. If you think of the newline characters as separators between the lines 2 it appears a new line is created. I can't think of an objective reason to prefer either way. Is there some use case where you would not want the "added" trailing newline? Footnotes |
I think this is a bug. Moving line 2 up in a file with 2 lines should not end up with 3 lines no matter how you phrase it it is just not the expected result. |
And it doesn't if you think of the newline character as part of the line: I understand that the current behavior is unexpected (to some) but I'm not sure if there's an use case where it's undesirable. |
I get your point on considering So if you want to have a new line at the very end of the file — just add it yourself after moving the text. That's why in (most) formatters having a trailing newline is an option. As @hholst80 noticed, getting an "out of nowhere" new line is still an undesired thing in itself. I'd like to have control and don't want to be distracted by such a paper cut. My point is that moving text should be bounded by the Thanks! |
If there is an empty line below the current line, swapping lines (using
⌥↓
) creates new empty lines.Becomes (after pressing twice)
Also:
Press
⌥↑
and You getThe text was updated successfully, but these errors were encountered: