Sublime Forum

[BUG] trim_trailing_white_space_on_save removes redo history

#1

If the setting trim_trailing_white_space_on_save is set to true, the redo-history won’t be available after save.
To see the bug in action, paste the following in a file:

sdfjkhsdkjh
  
sdfsdf

asd

On line 2 there are two whitespaces. Now add some characters on the last line, undo this by hitting ctrl/cmd+z and save the file. The whitepace characters will be removed, which is expected behaviour. However, if you want to redo the last modification, it won’t be possible.

0 Likes

#2

Hi,
I’m almost sure this wasn’t happening in ST3 until a couple of months ago or even less.
It’s a bug or it’s by design?

Frank

0 Likes

#3

oIt is not a bug, when the Sublime Text does the trim and the file is changed. Therefore Once the file is changed after the undo, the redo is/becomes invalid. This is why it is lost.

Just do not save the file, if you are planning to use the redo-history.

0 Likes

#4

are you sure?
I remember the contrary.
Maybe I’m wrong. Anyone else?

Thanks
Frank :wink:

0 Likes