Bug 434062

Summary: when I close a file it jumps not to the previous selected
Product: [Applications] kate Reporter: Dmitri Koulikoff <kde>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: christoph, nate, waqar.17a
Priority: NOR    
Version: 20.12.2   
Target Milestone: ---   
Platform: Slackware   
OS: Linux   
Latest Commit: Version Fixed In: 22.04
Sentry Crash Report:
Attachments: after closing a file kate selects not the previously used.

Description Dmitri Koulikoff 2021-03-06 17:27:22 UTC
SUMMARY

Until recent when I close a file the previous selected file become the active.
But now it is broken


STEPS TO REPRODUCE
1. Open several files.
2. Select them in arbitrary not repeating order and fix it.
3. Close a file.

OBSERVED RESULT

Current file is not the previously selected.


EXPECTED RESULT

Current file must be the previously selected. If you continue closing file they shold appear in the reverse order you've fixed.


SOFTWARE/OS VERSIONS
Operating System: Slackware-current
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Kernel Version: 5.10.20
OS Type: 64-bit
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-9750H CPU @ 2.60GHz
Memory: 31.1 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630
 

ADDITIONAL INFORMATION
Comment 1 Dmitri Koulikoff 2022-01-16 13:36:23 UTC
Please, fix it. This bug is very annoying.
Comment 2 Waqar Ahmed 2022-01-16 13:52:17 UTC
Trying on 21.12, If I close a tab, it takes me to the previous one. Can you try with the latest please?

And if the bug is still reproducible, maybe you have more detailed steps on how to reproduce this or a video.
Comment 3 Dmitri Koulikoff 2022-01-16 15:19:08 UTC
(In reply to Waqar Ahmed from comment #2)
> Trying on 21.12, If I close a tab, it takes me to the previous one. Can you
> try with the latest please?
> 
> And if the bug is still reproducible, maybe you have more detailed steps on
> how to reproduce this or a video.

See the new attachment
Comment 4 Dmitri Koulikoff 2022-01-16 15:19:51 UTC
Created attachment 145545 [details]
after closing a file kate selects not the previously used.
Comment 5 Dmitri Koulikoff 2022-01-16 15:20:32 UTC
I used ctrl+W to close a file.
Comment 6 Waqar Ahmed 2022-01-16 16:16:32 UTC
Tried again a few times, can not reproduce. 

Maybe you have some config that triggers this bug.
Comment 7 Dmitri Koulikoff 2022-01-16 17:06:50 UTC
(In reply to Waqar Ahmed from comment #6)
> Tried again a few times, can not reproduce. 
> 
> Maybe you have some config that triggers this bug.

It is possible. Which config do you need? I'll send you it.
Comment 8 Waqar Ahmed 2022-01-16 19:56:10 UTC
Not sure which config. We do not have any configs controlling this behavior I think. 

Do you limit the number of tabs?

It could probably be some particular access pattern causes this. Can you reliably reproduce this all the time or only sometimes?
Comment 9 Dmitri Koulikoff 2022-01-16 20:31:33 UTC
> Do you limit the number of tabs?

Yes, I do, of course. But it must not touch the history of the visited file.
Comment 10 Dmitri Koulikoff 2022-01-16 20:32:59 UTC
(In reply to Dmitri Koulikoff from comment #9)
> > Do you limit the number of tabs?
> 
> Yes, I do, of course. But it must not touch the history of the visited file.

… files
Comment 11 Christoph Cullmann 2022-02-11 22:10:26 UTC
I can reproduce that, it will stay on the same tab (if limited) and fill there in the next document that has no tab ATM.
Comment 12 Bug Janitor Service 2022-02-20 17:05:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/625
Comment 13 Christoph Cullmann 2022-02-20 17:10:50 UTC
Git commit 8573b12496d6ee26c5ab868734bf18ccf9395390 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 20/02/2022 at 17:07.
Pushed by cullmann into branch 'master'.

Fix LRU tab behaviour

M  +10   -0    kate/kateviewspace.cpp

https://invent.kde.org/utilities/kate/commit/8573b12496d6ee26c5ab868734bf18ccf9395390