Bug 479461 - When saving a text file kate always appends a new line at the end
Summary: When saving a text file kate always appends a new line at the end
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 23.08.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-06 11:27 UTC by pietz
Modified: 2024-01-08 16:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description pietz 2024-01-06 11:27:56 UTC
STEPS TO REPRODUCE
1. Create a text file with some chars. Ensure NO new line at the end
2. Save the flie
3. Kate appended a \n at the end.

OBSERVED RESULT
\n at the end

EXPECTED RESULT
Saving as I typed everything
Comment 1 Christoph Cullmann 2024-01-06 14:42:27 UTC
That is intended behavior and follows a lot of other editors.
You can turn it off in the configuration dialog under 'Open/Save'.
Comment 2 pietz 2024-01-06 15:51:47 UTC
Uups :) Okay, but WHAT is the benefit of that? Why do people like it that way? …or even expect it to change the bytes it magically?
Comment 3 Kåre Särs 2024-01-08 16:50:03 UTC
A file that does not end with a \n looks like it is truncated.