Bug 505382 - "Remove Trailing Spaces: Never" doesn't work
Summary: "Remove Trailing Spaces: Never" doesn't work
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 23.08.5
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-09 14:44 UTC by Antoine Pitrou
Modified: 2025-06-09 16:52 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 25.04
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Pitrou 2025-06-09 14:44:42 UTC
SUMMARY

I have configured "Remove trailing spaces" to "Never" in the Kate configuration.

Yet, if I open a file with existing trailing spaces, edit a bit, then save it, then trailing spaces are automatically removed by Kate. I have tried with a C++ file and a regular text file, to make sure this wasn't specific to a file type.

I have also tried setting "Remove trailing spaces" to "On modified lines" and got the same result.

STEPS TO REPRODUCE
1. Set "Remove trailing spaces" to "Never" in the Kate configuration dialog; press "Apply" and close
2. Open a file with existing trailing spaces
3. Edit the file in some other places
4. Save the file

OBSERVED RESULT

Trailing spaces have been removed on saving, despite Kate being told not to do so.

EXPECTED RESULT

Trailing spaces should have been left intact.

SOFTWARE/OS VERSIONS
Ubuntu 24.04
Kate 23.08.5
(running on a XFCE desktop)
Comment 1 Antoine Pitrou 2025-06-09 14:46:52 UTC
This seems to be a regression. Kate 21.12.3 on Ubuntu 22.04 worked fine.
Comment 2 Christoph Cullmann 2025-06-09 15:59:22 UTC
Works for me in current versions like 25.04.2
Comment 3 Antoine Pitrou 2025-06-09 16:04:55 UTC
Hmm, is there an easy way to test a newer Kate on Ubuntu 24.04?
Comment 4 Christoph Cullmann 2025-06-09 16:05:24 UTC
You can try the Kate snap.
Comment 5 Antoine Pitrou 2025-06-09 16:13:47 UTC
Oh, great, thank you. I can indeed confirm that it fixes the issue here.
Comment 6 Christoph Cullmann 2025-06-09 16:52:06 UTC
Nice that this did work for you. Sorry that it was broken.