SUMMARY kate 17.12.3 remembered the current cursor position and restored it when reloading the text file, but since 18.04 the cursor is always at the top. Seems to only happen in an unnamed session though, when explictly saving the session and restoring it later the cursor position is restored too. If I load a file last edited with 17.12.3 in a newer version, it seems to restore the cursor position as well. STEPS TO REPRODUCE 1. run kate 2. enter some text, move/keep the cursor on some arbitrary position (other then at the beginning of the first line) and save it 3. restart kate and load the text file OBSERVED RESULT The text cursor is on the beginning of the first line. EXPECTED RESULT The cursor should be where it was left when saving/closing kate. KDE Plasma Version: 5.14.5 KDE Frameworks Version: 5.53.0 Qt Version: 5.12.0 ADDITIONAL INFORMATION Downgrading kate to 17.12.3 makes it work again, with the very same KDE Frameworks/ktexteditor and Qt versions. Originally reported at https://bugzilla.opensuse.org/show_bug.cgi?id=1120845, but I don't think it is distribution specific.
It seems this issue is caused by this commit: https://cgit.kde.org/kate.git/commit/?id=e3ece7bd45d2743b3c36ad856abd12ac9ba282d6 closeDocument(untitledDoc) isn't called, so this chain doesn't happen: KateDocManager::documentsDeleted -> KateViewManager::documentsDeleted -> KateViewManager::createView, the latter calls KTextEditor::View::readSessionConfig() to restore the cursor position.
(In reply to Ahmad Samir from comment #1) > It seems this issue is caused by this commit: > https://cgit.kde.org/kate.git/commit/ > ?id=e3ece7bd45d2743b3c36ad856abd12ac9ba282d6 > > closeDocument(untitledDoc) isn't called, so this chain doesn't happen: > KateDocManager::documentsDeleted -> KateViewManager::documentsDeleted -> > KateViewManager::createView, the latter calls > KTextEditor::View::readSessionConfig() to restore the cursor position. I have confirmed this is still an issue. Ahmad would you be interested in providing a patch to fix this behaviour? If you would like to submit a merge request to fix it, you can do so here: https://invent.kde.org/utilities/kate/-/merge_requests
Can someone test if this bug is still present?
Since the referenced commit got mostly reverted and I can no longer reproduce this bug => fixed