https://bugs.kde.org/show_bug.cgi?id=490637

            Bug ID: 490637
           Summary: Kate displays newline at the end of file when there
                    isn't
    Classification: Applications
           Product: kate
           Version: 24.05.2
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: application
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: fe...@feldspaten.org
  Target Milestone: ---

SUMMARY

Kate displays a newline at the end of a file, even when there isn't one there.
This is annoying when editing a yaml file where the linter expects you to have
a newline at the end of the file. In kate the editor shows a newline at the end
of the file, but the file contents don't have this newline.

The annoying part is that even when adding a newline within kate, kate won't
save it. So there is no way to make the yaml linter happy.

The Setting "Append newline at end of file on save" In "Open/Save" does not
seem to have an effect.

STEPS TO REPRODUCE

1. Create new file with the following contents:

```yaml
---

key: "value"
```

2. Save the file
3. Kate will add a newline (Line 4) in the display
4. Check the file with any other editor, e.g. `vim`. The immaginary newline is
not there
5. `yamllint` will complain about the missing newline

OBSERVED RESULT

* Newline is displayed but not saved
* Enabling/Disabling the "Append newline at end of file on save" does not seem
to have any effect on this issue

EXPECTED RESULT

* Newline is only displayed if present
* If present, the newline character at the end of the file will be saved to
disk

SOFTWARE/OS VERSIONS

openSUSE Tumbleweed 20240716
KDE Plasma Version: 6.1.2
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION

None

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to