syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.58k stars 4.9k forks source link

Overzalous whitespace cleanup despite settings in `init.el` #12841

Open grendello opened 4 years ago

grendello commented 4 years ago

Description :octocat:

Spacemacs appears to ignore the dotspacemacs-whitespace-cleanup setting for some files in a number of modes.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: The extra whitespace outside the line that was just change is stripped on save. Additionally, the save removes the BOM from the start of the file. My Emacs is configured to open the .targets file in nxml mode, but the stripping also happens in C++, C# and plain text modes. It is a regression, however I cannot tell when it was introduced :( I noticed it a month or so ago. As much as I don't like the extra whitespace :), the behavior is a real annoyance when dealing with files like the one linked to above since any edit introduces lots of noise irrelevant to the actual changes.

Expected behaviour: :heart: :smile: Whitespace on lines not touched by editing is left intact.

System Info :computer:

humanfactors commented 4 years ago

Is the behavior occurring because your Emacs config/settings are default saving to UTF-8 without BOM (i.e., check your settings), in effect changing all lines in the file, so whitespace cleanup cleans everything?

grendello commented 4 years ago

All the config/settings values pertaining to UTF-8/Unicode are at their default values (whatever the config variables are, I couldn't find any :D), I don't have any settings modifying that behavior in my init.el

Blaisorblade commented 4 years ago

I have the same issue, at least on LaTeX files: dotspacemacs-whitespace-cleanup, even set to changed, cleans up all whitespace as soon as the file is saved (after any change).

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

Blaisorblade commented 3 years ago

Still observing this with dotspacemacs-whitespace-cleanup 'changed — (as of spacemacs 76301564c5fa6fbd4a9a07ef35529d931aecd367); later commits messages don't mention "whitespace".

Blaisorblade commented 3 years ago

Seems either @github-actions is buggy, or admins have to react to comments by hand. I accept the defacto bug bankruptcy.

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!