Bug 502857

Summary: When in indentation (why?) "keep remaining spaces" (conserver mes caractères supplémentaires) is checked, when line finished by a slash and a space, the space is removes when saving the file.
Product: [Applications] kate Reporter: Hugues MOISY <huguesmoisy>
Component: indentationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: waqar.17a
Priority: NOR    
Version First Reported In: 23.08.5   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Hugues MOISY 2025-04-15 19:55:38 UTC
SUMMARY
When in indentation (why?) "keep remaining spaces" (conserver les caractères supplémentaires) is checked, when line is finished by a slash and spaces after the slash (which I absolutely need to keep in my work), the spaces are removed when saving the file. They are still in the file as long as the has been no "Save to" 

STEPS TO REPRODUCE
1. Open a new file and type a line like "my line with a slash and spaces : /      " (without the "")
2. Copy the line or create new ones with a slash and spaces at the end
3. Save the file.

OBSERVED RESULT
The spaces will be removed. It doesn't occur with lines having no slash before the remaining spaces. Didn't check with other special characters.

EXPECTED RESULT
The text should have stayed the same, as the option is checked in Modification/Indentation/Propriétés d'indentation/Conserver les caractères supplémentaires.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
(available in the Info Center app, or by running `kinfo` in a terminal window)
Linux/KDE Plasma: Kubuntu 24.04
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13

ADDITIONAL INFORMATION
Comment 1 Waqar Ahmed 2025-04-16 09:48:14 UTC
"Keep extra spaces" is not what you think it is.

For your purpose, change the following settings: Open/Save -> General tab -> Remove Trailing Spaces