Bug 395208 - Kate turns U+2028 LINE SEPARATOR into ASCII new lines
Summary: Kate turns U+2028 LINE SEPARATOR into ASCII new lines
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 18.04.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-10 09:58 UTC by Louis Moureaux
Modified: 2023-08-03 19:48 UTC (History)
2 users (show)

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


Attachments
File with U+2028 (19 bytes, text/plain)
2020-11-13 15:32 UTC, Louis Moureaux
Details
File saved by Kate (17 bytes, text/plain)
2020-11-13 15:33 UTC, Louis Moureaux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Louis Moureaux 2018-06-10 09:58:01 UTC
When opening a file containing U+2028 LINE SEPARATOR and saving it under another name, Kate turns each line separator into two plain ASCII newlines, even if the document wasn't modified.

This is especially problematic with version control systems, see eg https://github.com/cms-gem-daq-project/gem-plotting-tools/pull/109#pullrequestreview-126431811

Thank you for maintaining such a great editor!
Comment 1 Justin Zobel 2020-11-13 03:30:49 UTC
Can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I'm setting status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thanks.
Comment 2 Louis Moureaux 2020-11-13 15:32:44 UTC
Created attachment 133303 [details]
File with U+2028

Open in Kate, save as and diff the new file wrt the old one.
Comment 3 Louis Moureaux 2020-11-13 15:33:31 UTC
Created attachment 133304 [details]
File saved by Kate
Comment 4 Louis Moureaux 2020-11-13 15:35:13 UTC
Still present in Kate 20.08.03 (Arch Linux, Qt 5.15.1, ktexteditor 5.75.0)
Comment 5 Justin Zobel 2020-11-14 00:22:45 UTC
Thanks for the added information. Can confirm after saving the file is different.
Comment 6 Christoph Cullmann 2023-08-03 19:48:02 UTC
I checked that and yes we convert that, like we convert other mixed line endings into the current 'normal one', too.
I don't see that we want to change that, writing out files with mixed line endings is close to never a good idea.
If one wants that, this is a new feature somebody will need to contribute, see https://kate-editor.org/post/2020/2020-07-18-contributing-via-gitlab-merge-requests/