Bug 454703

Summary: Saving file adds empty line at the end if there isn't already one
Product: [Applications] kate Reporter: pompabidu
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: minor CC: waqar.17a
Priority: NOR    
Version First Reported In: 22.04.1   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description pompabidu 2022-06-01 12:18:34 UTC
SUMMARY
Saving a file adds an empty line at the end of the file if the last line was not already empty.

STEPS TO REPRODUCE
1. Open a new file in Kate.
2. Type text such that the last line is not empty.
3. Save the file anywhere.

OBSERVED RESULT
An empty line is added at the end of the file. Opening the file in another editor shows the empty line.

EXPECTED RESULT
The file should be saved without an additional empty line.

SOFTWARE/OS VERSIONS
Observed on Artix, both under X and Wayland, and on Manjaro under X.
Version numbers for both cases:
Kate 22.04.1
KDE Frameworks 5.94.0
Qt 5.15.4 (built against 5.15.3)
Comment 1 Waqar Ahmed 2022-06-01 13:24:06 UTC
Configure Kate -> Open/Save -> disable "Append new line at the end of file"
Comment 2 pompabidu 2022-06-03 20:22:05 UTC
My bad, you're right.
Still, I think it's a strange choice to put this as default.