When using :opt:strip_trailing_spaces do not remove empty lines

Fixes #1802
This commit is contained in:
Kovid Goyal 2019-07-15 17:17:40 +05:30
parent b7a11035d5
commit 9368f7f670
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 1 deletions

View File

@ -49,6 +49,9 @@ To update |kitty|, :doc:`follow the instructions <binary>`.
- ssh kitten: Make argument parsing more like ssh (:iss:`1787`)
- When using :opt:`strip_trailing_spaces` do not remove empty lines
(:iss:`1802`)
0.14.2 [2019-06-09]
---------------------

View File

@ -469,7 +469,7 @@ class Window:
lines = self.screen.text_for_selection()
if self.opts.strip_trailing_spaces == 'always' or (
self.opts.strip_trailing_spaces == 'smart' and not self.screen.is_rectangle_select()):
lines = [l.rstrip() for l in lines]
lines = ((l.rstrip() or '\n') for l in lines)
return ''.join(lines)
def destroy(self):