Remove trailing spaces on empty lines
danielmeer opened this issue · 2 comments
danielmeer commented
Hi,
It would be great to have the option to remove all trailing white space. The MATLAB indentation function (Ctrl+i) already handles this for lines containing code, but it adds spaces on empty lines up to the current indentation level.
The current behavior is like this (I added dots to show the spaces):
for true
....
a = 1;
....
end
And I would like this:
for true
a = 1;
end
I think something like this regex should do the trick: regexprep(text, '^\s+$', '', 'lineanchors')
davidvarga commented
Hi,
it seems quite simple to be implemented - I'll take care in short time.
Thanks for the proposal.
davidvarga commented
Hi, I implemented it - in the evening I can push it. I made it default as it can lead to smaller file sizes.