Patch for trailing whitespace removal behavior

Subramaniyam Raizada subraizada3 at gmail.com
Tue Apr 17 08:34:58 UTC 2018


Hi,

I edited the KTextEditor to not clear trailing space from the line the
cursor is currently on.

This is useful for those who save often, because without this, typing
something like this (dots = space):

if (condition) {
....<-- cursor here
} <autocompleted end bracket>

and saving or pausing to take a break (which would involve saving)
results in the autoindent being lost, and the cursor going back to the
beginning of the line.

It still removes trailing whitespace when the cursor is not on the end
of the line. With this example:

abc..
a.b...cdde..<cursor here>...
def.....

all trailing whitespace will be removed. The whitespace on lines 1/3
will be removed no matter what, and the trailing whitespace on line 2 is
removed because the cursor is not at the end of the line.

It did fail test #66 'vimode_keys' when I ran `make test`. I believe
this may be related to bug 392858 - vi mode :q (quit) command works in
Kate but not KWrite <https://bugs.kde.org/show_bug.cgi?id=392858>

- Sub Raizada
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-don-t-remove-trailing-space-from-current-line.patch
Type: text/x-patch
Size: 1153 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20180417/7a2c304a/attachment.bin>


More information about the KWrite-Devel mailing list