Bug 453252 - 'Append newline to file on save' moves cursor on save
Summary: 'Append newline to file on save' moves cursor on save
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 22.04.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-01 06:22 UTC by Kishore Gopalakrishnan
Modified: 2022-05-02 05:49 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 Kishore Gopalakrishnan 2022-05-01 06:22:14 UTC
SUMMARY
When Kate is set to append a newline to a file on save and the cursor is currently at the end of the file, the cursor moves to the next line when the user saves the file. 

STEPS TO REPRODUCE
1. Make sure Settings > Configure Kate> Open/Save > 'Append newline at end of file on Save' is enabled
2. Open any existing text file in Kate 
3. Type something on the empty last line
4. Place the cursor at the end of the newly typed last line
5. Press Ctrl+S (save)

OBSERVED RESULTS
Cursor is automatically moved to the newline that was inserted after the last line

EXPECTED RESULTS
Cursor should not be automatically moved when the user saves a file

SOFTWARE VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.15.36-1-lts (64-bit)
Graphics Platform: X11
Comment 2 Christoph Cullmann 2022-05-02 05:49:26 UTC
Git commit a1b91bacd3b919c41c68b3aed79577d2408e9564 by Christoph Cullmann.
Committed on 02/05/2022 at 05:34.
Pushed by cullmann into branch 'master'.

avoid cursor move on insert of line at EOF on save

M  +16   -0    src/document/katedocument.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/a1b91bacd3b919c41c68b3aed79577d2408e9564