Bug 506956 - Cursor position is not saved for closed tabs other than last active tab
Summary: Cursor position is not saved for closed tabs other than last active tab
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: sessions (other bugs)
Version First Reported In: 25.04.3
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-12 15:27 UTC by user7098473
Modified: 2025-07-13 17:21 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description user7098473 2025-07-12 15:27:47 UTC
SUMMARY
Cursor position is not saved for closed tabs other than last active tab.

STEPS TO REPRODUCE
1. In a session, open two or more tabs with enough content to scroll through.
2. Scroll down to any position in two or more tabs.
3. Close and open Kate and open same session as in step 1.

OBSERVED RESULT
The last active tab (the tab that was open before Kate was closed) will have its cursor position remembered. All other tabs have their cursor position set to the top, discarding the previous cursor position.

EXPECTED RESULT
The cursor position should be where it last was before closing for all tabs and not just the last active tab. 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 6.4.2
KDE Frameworks Version: 6.16.0
Qt Version: 6.9.1

ADDITIONAL INFORMATION
Kate Version 25.04.3
Comment 1 Bug Janitor Service 2025-07-13 12:43:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1816
Comment 2 Christoph Cullmann 2025-07-13 13:44:21 UTC
Git commit f5ac709b3aab7228a269eb5bb869a21551267a26 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 13/07/2025 at 13:44.
Pushed by cullmann into branch 'master'.

Fix cursor position not being restored with multiple views

The session autosave that we trigger when starting up should specify
autosave=true, otherwise during session save we delete the session
config groups when saving data.

Add a test for this case, it starts up the app then opens a session
with 2 docs and then sets cursor position. We then close the app and
start up again similar to how the app is started in real world. Then
we check whether cursor position is correct

M  +75   -0    apps/lib/autotests/kate_view_mgmt_test2.cpp
M  +1    -1    apps/lib/kateapp.cpp

https://invent.kde.org/utilities/kate/-/commit/f5ac709b3aab7228a269eb5bb869a21551267a26
Comment 3 Christoph Cullmann 2025-07-13 17:21:55 UTC
Git commit 2c3091304c550e2355d0a4b3cf7749b1dbded272 by Christoph Cullmann.
Committed on 13/07/2025 at 17:21.
Pushed by cullmann into branch 'release/25.08'.

Fix cursor position not being restored with multiple views

The session autosave that we trigger when starting up should specify
autosave=true, otherwise during session save we delete the session
config groups when saving data.

Add a test for this case, it starts up the app then opens a session
with 2 docs and then sets cursor position. We then close the app and
start up again similar to how the app is started in real world. Then
we check whether cursor position is correct


(cherry picked from commit f5ac709b3aab7228a269eb5bb869a21551267a26)

Co-authored-by: Waqar Ahmed <waqar.17a@gmail.com>

M  +75   -0    apps/lib/autotests/kate_view_mgmt_test2.cpp
M  +1    -1    apps/lib/kateapp.cpp

https://invent.kde.org/utilities/kate/-/commit/2c3091304c550e2355d0a4b3cf7749b1dbded272