andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Strip ending whitespace #135

Closed yajo closed 10 years ago

yajo commented 10 years ago

Really needed plugin. Better with option: "only on changed lines".

andreikop commented 10 years ago

Could you please add detailed specification: how and when to perform, how and where to configure?

yajo commented 10 years ago

When: On save seems the easiest option here.

How: right-trim all lines. I imagine that the option to trim only the edited lines of the document is a bit trickier, so it could be implemented later.

Where to configure: Settings > Editor > EOL seems a good place to put a couple of checkboxes labeled "Remove trailing whitespace on save" and another one, if the first one is true, labeled "Only on changed lines".

It would be very helpful. Thanks!

andreikop commented 10 years ago

I committed to enki master experimental functionality. It can not be configured now. All lines are stripped, not only modified ones.

I also modified auto indentation algorithms in Qutepart. Now if line is empty and Tab is pressed, line is autoindented smartly. It should simplify editing of trailing-whitespace-free code.

Let's test this changes. If all works fine, I'll add configuration and include new functionality to the next release.

Merry Christmas!

andreikop commented 10 years ago

Now functionality is configurable. Checkbox in Edit menu is switched off by default.