zed icon indicating copy to clipboard operation
zed copied to clipboard

Add option "remove_trailing_whitespace_on_save": "only on the lines I modified"

Open Vlad-Shcherbina opened this issue 1 year ago • 1 comments

Some people don't care about trailing whitespaces. Some people do care and think there should be none.

There could be a mix of both in a team.

In relaxed hobby projects it is unpleasant to coerce everyone to one of these philosophies.

However, people who care and set up "remove_trailing_whitespace_on_save": true will run into inconveniences, because their commits will touch unrelated lines.

The "remove_trailing_whitespace_on_save": "only on the lines I modified" variant would minimize conflicts in mixed teams.

Vlad-Shcherbina avatar Aug 23 '24 16:08 Vlad-Shcherbina

JetBrains supports this.

image

notpeter avatar Aug 23 '24 16:08 notpeter

Just got hit with "remove_trailing_whitespace_on_save" doing it's silent space removal and having diff tool to ignore whitespace changes.. my mistake, but still a behaviour that's "wrong" from my point of view.

In a large text file with 100s of space separated value with ancient formatting rule to allow "double space" to indicate something without value. Lines i did not edit or touch had their "extra spaces" silently removed. Managed to push those to git (with ignore whitespace hidden ;). Luckily pipeline had checks which managed to catch these so no harm was done.

ljack avatar Dec 05 '24 06:12 ljack