Bug 505382

Summary: "Remove Trailing Spaces: Never" doesn't work
Product: [Applications] kate Reporter: Antoine Pitrou <pitrou>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph
Priority: NOR    
Version First Reported In: 23.08.5   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 25.04
Sentry Crash Report:

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.