Bug 468385 - Interprete LF as line terminator instead of line separator
Summary: Interprete LF as line terminator instead of line separator
Status: RESOLVED NOT A BUG
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-11 09:13 UTC by Christian Stoller
Modified: 2023-04-11 15:10 UTC (History)
1 user (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 Christian Stoller 2023-04-11 09:13:03 UTC
SUMMARY
-------
In Linux the LF character is not regarded as a line seperator, but as a line terminator, where all valid lines should end with LF. You can read more about that distinction at https://en.wikipedia.org/wiki/Newline#Interpretation.

If you create an empty file on Linux in Kate, insert some characters (without pressing return key) and save, it won't add the line terminator LF. But this should be done on linux text files (see https://superuser.com/a/745135/248359 or https://vi.stackexchange.com/a/11630).

The current behaviour leads to issues when you are using tools like cat or Git.

STEPS TO REPRODUCE
------------------
1. Create an empty file in Kate and enter "TEST" without pressing the return key
2. Save the file

OBSERVED RESULT
---------------
Running `cat file_created_by_kate.txt` at the terminal will output

> naitsirch@linux1:~$ cat file_created_by_kate.txt
> TESTnaitsirch@linux1:~$

EXPECTED RESULT
---------------
> naitsirch@linux1:~$ cat file_created_by_kate.txt
> TEST
> naitsirch@linux1:~$

SOFTWARE/OS VERSIONS
--------------------
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel-Version: 5.10.0.9-amd64
Comment 1 Waqar Ahmed 2023-04-11 09:25:35 UTC
Open Kate settings (Ctrl + ,), search for "Append new line" and check this setting
Comment 2 Christian Stoller 2023-04-11 15:10:20 UTC
Sorry, I did not know about this setting. Thanks for your hint.