Bug 344374 - Allways one same tab in all split views
Summary: Allways one same tab in all split views
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 18.04.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-20 02:37 UTC by c3767438
Modified: 2022-02-11 20:09 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description c3767438 2015-02-20 02:37:01 UTC
Reproducible: Always

Steps to Reproduce:
1. Open Kate
2. Open file A
3. Split view (File A in both splits)
4. Open file B in 2nd split
5. Close file A in 2nd Split

Actual Results:  
File B in both splits

Expected Results:  
File A in 1st split
File B in 2nd split
Comment 1 Álex Puchades 2015-08-08 22:45:04 UTC
I can confirm this behaviour
Comment 2 Dominik Haumann 2015-08-09 20:06:12 UTC
I'll have a look soon, probably this should be changed.
Comment 3 11wallace11 2018-05-03 10:12:05 UTC
This bug is still present in version 18.04. 
Since it's been almost 3 years, is it expected to be fixed any time in the future?
Comment 4 Christoph Cullmann 2018-07-14 14:44:54 UTC
The question is: What is the intended behavior?

At the moment, if you close a tab, this means, you close the document.

Even if you have it open in X splits or mainwindows, it will be closed.

This leads to the observed behavior.

And I think that is the way it should be.
Otherwise, you can't just really close a document easily anymore, as it will stay open, as long as it was ever open in some other tab or mainwindow, which IMHO is even more confusing.
Comment 5 haligh 2021-10-06 10:37:48 UTC
This topic seems to be very old, but in fact i would love to use Kate for bigger projects as a dev, so far i am limited to small project for exactly this bug. In my opinion the intended behaviour is as follows:

When you split a view vertically or horizontally, 2 seperate views are visible with equal size. Ideally the top/left view shows the original tabs and the new view is empty (so do not duplicate the document). I can then more tabs between different views. On closing a file, it only closes its current representation, not any duplicate.

The reason behind this is that those split views are good to see several files at once. I usually have around 10+ open files at once. The way Kate treats this now leads to 
1) each split having ALL files in them, hard to navigate between them
2) forcing a really complex order of opens and close to have an instance of each file appearing in ONE view only.

Maybe there is some other use of those splits that i do notbenefit from, but i do not see how Christoph Cullmann's intended behaviour helps simplifying navigation.

Would be really nice to get this back to the bug list, as i really believe in the power of Kate, even in comparison to all those super IDEs nowadays.
Comment 6 Waqar Ahmed 2022-01-15 11:38:21 UTC
A lot of people seem to be having trouble figuring this out so I think our behaviour is probably not very intuitive. It is certainly different from what everyone else is doing. Hence I am reopening this.
Comment 7 Bug Janitor Service 2022-01-15 11:57:52 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/560
Comment 8 Christoph Cullmann 2022-01-17 19:34:27 UTC
Git commit 9880babc69472a97dd6d095dd39205099d6d4995 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 17/01/2022 at 19:28.
Pushed by cullmann into branch 'master'.

Improve views closing in split view behaviour

Currently if you have a doc that has 2 views in 2 different splits:

A | A

and you close one of them, it closes the other as well. This behaviour
is really non-intuitive and is very unexpected to say the least. To
start with, no one asked kate to close the other view so it shouldn't
auto close it.

Moreover suppose you have a viewspace with:

AB

and you want to open a new split, the new split will open to the *left*
of the current one resulting in: A | AB, instead of AB | A. This is
the opposite of what any app does.

With this change, I am proposing a different solution:
- If a doc has multiple views, only close the one that the user asked
  for in the current viewspace.
- If the viewspace becomes empty, there is no need to refill it, close
  the viewspace. If this is the last viewspace, it remains open.
- Lastly, when doing vertical split, open the new viewspace *after* the
  current one not before.

This behaviour is consistent with other editors and apps doing splits.

M  +14   -4    kate/kateviewmanager.cpp
M  +3    -1    kate/kateviewmanager.h
M  +29   -1    kate/kateviewspace.cpp
M  +7    -0    kate/kateviewspace.h

https://invent.kde.org/utilities/kate/commit/9880babc69472a97dd6d095dd39205099d6d4995