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
Add line missing line ending. #6
Conversation
I cannot reproduce this, could you give me an example of a block of lines and what part to select before doing the sort? I could only make it happen by selecting the lines I wanted to sort and also including the last line break, i.e. selecting up until the first position of the next not selected line, if that makes any sense. |
Your explanation makes total sense, and that is usually how I select lines to sort. |
Sounds entirely reasonable to mimic the built-in sort behavior, so this change should look if the last character is a line ending and only add one if there was one before. Otherwise it would add an unwanted line ending if the selection is up to the last character of the last line instead. |
Agreed, I have updated my pull request to respect the last character(s) of the region. |
I think it can be much simpler, something like:
I hope you are not annoyed by my suggestions :) |
Also reminds me that I should really add some tests… |
When reassembling the lines, no line ending were added to the last line, even if the selection ended with a line ending character. This caused the following line to be pulled up unto the last line of the selected block.
Not annoyed at all 😄 |
Great, this is perfect. Will merge it as soon as I'm on my main computer and can test it one last time myself. |
Jabba the smiley! (...or more likely his sister) |
Add line missing line ending.
When reassembling the lines, no line ending were added to the last line.
This caused the following line to be pulled up unto the last line of the selected block.