Skip to content

Commit

Permalink
Add line missing line ending.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
davidolrik committed Aug 31, 2015
1 parent 83e1ef5 commit 5cef096
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions SortNumerically.py
Expand Up @@ -29,4 +29,8 @@ def run(self, edit):

output = line_ending_character.join(sorted_lines)

# If the end of the region had a line ending character, we re-add it here
if self.view.substr(region).endswith(line_ending_character):
output += line_ending_character

self.view.replace(edit, region, output)

0 comments on commit 5cef096

Please sign in to comment.