Bug 389169 - Most recently used files should be the visible tabs (Default for MRU)
Summary: Most recently used files should be the visible tabs (Default for MRU)
Status: CLOSED DUPLICATE of bug 388476
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-10 11:10 EDT by Jason Fritz CLA
Modified: 2013-11-13 06:14 EST (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Fritz CLA 2012-09-10 11:10:46 EDT
I just upgraded from Eclipse Indigo to Juno.  I was surprised/disappointed that the visible tabs (open files) are no longer based on the most recently used files, but some other (unknown) criteria.

E.g. I will be viewing/editing one file, then switch to another file by clicking the >> icon and choosing it.  The visible tabs will completely change and the last file I was editing will no longer be a visible tab.  I have to use the >> icon to find it.

I work on a very large code base and this makes flipping back and forth between files very difficult.

This -may- be related to the directory heirarchy.  I'm flipping between files in two totally different hierarchies.

I am using the C++ plugin, btw.  I have not tested this for Java.

I also have the "Link with Editor" option checked in the Project Explorer.  But unchecking it does not change this behavior.

Other people seem to be having this problem.  See for example:
http://stackoverflow.com/questions/11255389/retain-previous-open-file-tab-under-visible-tabs
http://sachinpatil.com/blog/2012/07/31/eclipse-juno-rememberer-previously-open-file-tabs-under-visible-tabs/
Comment 1 Jason Fritz CLA 2012-09-10 11:21:27 EDT
Also, people report that changing the theme (Preferences->General->Appearance) fixes the problem.  My theme was "GTK".  But changing my theme to "Default" or "Classic" doesn't seem to fix the problem for me.
Comment 2 Paul Webster CLA 2012-09-10 12:32:29 EDT
To get MRE behaviour back, you should be able to switch to the Classic theme and restart your eclipse.

Windows 7 doesn't have MRU on by default in the classic style, but you're on WindowsXP, right?




PW
Comment 3 Jason Fritz CLA 2012-09-10 17:53:18 EDT
Hi Paul, is your comment meant to be a fix or is it just a temp workaround?

I verified this works for me (had to close/restart Eclipse).
Comment 4 Jason Fritz CLA 2012-09-10 17:55:06 EDT
BTW, forgot to mention that I'm actually running Eclipse from Linux and exporting the display to Windows XP.  I changed the bug header to list Linux as the OS.
Comment 5 Paul Webster CLA 2012-09-11 12:22:05 EDT
(In reply to comment #3)
> Hi Paul, is your comment meant to be a fix or is it just a temp workaround?
> 
> I verified this works for me (had to close/restart Eclipse).

There should have been an info dialog when you switched to classic theme and Applied that mentioned you have to restart ... maybe that fix went into SR1 (due out soon).

PW
Comment 6 Paul McConkey CLA 2012-10-04 04:14:20 EDT
(In reply to comment #1)
> Also, people report that changing the theme
> (Preferences->General->Appearance) fixes the problem.  My theme was "GTK". 
> But changing my theme to "Default" or "Classic" doesn't seem to fix the
> problem for me.

Check this answer: http://stackoverflow.com/a/12642761/1719365

Modifying the CSS for the theme that you are using to set swt-mru-visible to true seems to return tab visibility to something sensible:

.MPartStack {
	... (clipped)
	swt-mru-visible: true;
}
Comment 7 Sampo Niskanen CLA 2012-10-11 02:15:00 EDT
I completely agree.  The (default) visible tabs seem to follow absolutely no logic and is driving me nuts.  MRU is easy to understand and works very well.  Will have to try switching themes if it will make it better.
Comment 8 Lars Vogel CLA 2012-11-08 08:27:15 EST
+1 for changing the default. 

Paul/Eric is this something you would consider for Eclipse 4.2.2 or Eclipse 4.3? In this case I can provide patches for the CSS files.
Comment 9 Paul Webster CLA 2012-11-08 09:40:25 EST
(In reply to comment #8)
> 
> Paul/Eric is this something you would consider for Eclipse 4.2.2 or Eclipse
> 4.3? In this case I can provide patches for the CSS files.

We walked away from the MRU behaviour because it was a somewhat hacky algorithm that never worked correctly.  Now the tabs are in document order (the order they were opened in).  It's not to be the default for the new theme.

But switching to Classic theme or editing the CSS can bring back that behaviour for those that want it.  It's improvements in editing the CSS and updating the http://wiki.eclipse.org/Eclipse4/CSS that we would focus on.

PW
Comment 10 Wim Jongman CLA 2012-11-08 10:36:48 EST
+1 for changing the defaults.

It is driving me nuts too. MRU, even if it was not perfect as you say, is so much better then the current default.
Comment 11 Paul Webster CLA 2012-11-08 12:53:57 EST
This has already been discussed when the decision was made to only keep MRU behaviour in the Classic theme:

- Bug 168379
- See Bug 68684 for an extensive discussion of tab ordering

If you want the MRU behaviour, editing the CSS is your best option.

PW
Comment 12 Lars Vogel CLA 2012-11-09 02:21:32 EST
After reading Bug 68684 and http://andrei.gmxhome.de/eclipseMRUbug.html I now agree that MRU should not be the default. Thank Paul for the clarification.
Comment 13 Thomas Schindl CLA 2012-11-09 02:28:46 EST
I would vote for an easier option to switch on the MRU but for that our CSS needs to get smarter and e.g. allow to access preferences values, ...
Comment 14 Lars Vogel CLA 2012-11-09 02:37:11 EST
@Tom: I think he discussing that in Bug 386470. Jeeeyuls theme has this feature already.
Comment 15 Thomas Schindl CLA 2012-11-09 09:32:11 EST
*** Bug 393979 has been marked as a duplicate of this bug. ***
Comment 16 Eric Moffatt CLA 2012-11-15 15:41:20 EST
<Sigh> I'll put my two cents worth in here...

As those of you who have looked into the [EditorMgmt] bugs there has *never* been a way of doing this that has pleased >20% of users. We need a way for folks to be able to either 'pick up' the behavior they want or write their own.

In 4.x we should look into whether it's possible to write an *addon* that supports MRU behavior, take the tab order away from the CTabFolder and give it over to the model.

This is almost quite easy I think:

1) Listen for part activations
2) If it's an editor move its MPart to the start its stack

I can help with the code but my point is that the way to manage things in a modeled UI is to manage the UI model. This implementation would give something close (at least) to the behavior you want while also maintaining the current CTF behavior of showing stuff in the 'document order' (IMO the current MRU handling done by the CTF is confusing since what I see on the screen doesn't match the order of the MParts in the model).

Once we have an addon that works we should make it available in the Eclipse Marketplace (along with whatever other approaches others may have contributed). 

This is IMO one of 4.x's greatest potential advantages; the platform doesn't have to make one monolithic chunk of code strewn with funky preference checks but instead allows the users to pick and choose which behaviors they want.
Comment 17 Paul Webster CLA 2012-12-06 07:30:22 EST
*** Bug 395908 has been marked as a duplicate of this bug. ***
Comment 18 Dani Megert CLA 2013-11-13 06:14:47 EST
.

*** This bug has been marked as a duplicate of bug 388476 ***