ouilles / pyscripter

Automatically exported from code.google.com/p/pyscripter
0 stars 0 forks source link

The tab of the active file is not always found #525

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. Open several tabs until there are some that are not shown on the editor tab 
bar
2. Select the rightmost tab (by using the tab dropdown selector).
3. Select the leftmost tab (by using the tab dropdown selector, since its tab 
will not be visible).
4. Close the current (leftmost) tab.
5. PyScripter automatically activates the rightmost tab, since it is the one 
that was active before.
6. The problem is that the corresponding tab is not shown because the tabbar 
does not scroll to the right.

This is quite annoying because it makes it hard to close the active tab.

This is with PyScripter 2.4.1.

Original issue reported on code.google.com by angel.ez...@gmail.com on 1 Jun 2011 at 5:58

GoogleCodeExporter commented 9 years ago
I would very much like to resolve this bug since other users have complained in 
the past about similar issues.  However I cannot reproduce it the way you 
describe it. In your step 4 after I close the leftmost tab, PyScripter 
activates the next one and it is properly shown.  The z-order of the tabs is 
not used when closing the tab as far as I can see.

When I close a tab **which is selected**  the previous one is selected unless 
it is the first tab in which case the next one is selected.   

I noticed though that the issue arises if I close a tab which is ** not 
selected ** (by pressing the x). This does not affect the selected tab but in 
some cases (when the selected tab is last) the selected tab disappears from 
view and you need to scroll to get back into view.

I have now corrected this last issue in version control and with it I believe 
the general issue of disappearing tabs.  Please check with the next version and 
report back if the issue exists.

Original comment by pyscripter on 4 Jun 2011 at 11:08

GoogleCodeExporter commented 9 years ago
I am surprised that you cannot reproduce this issue, since it happens
to me all the time. Hopefully your fix will also fix my problem!

Do you plan to make a new release soon? I'm looking forward to testing this fix.

Original comment by angel.ez...@gmail.com on 5 Jun 2011 at 12:46

GoogleCodeExporter commented 9 years ago
Could you please download here
http://code.google.com/p/pyscripter/downloads/detail?name=PyScripter.zip
and test?

Original comment by pyscripter on 5 Jun 2011 at 11:19

GoogleCodeExporter commented 9 years ago
Unfortunately this still does not work.
I think I found an easier way to reproduce the problem, and it is 100%
reproducible for me:

1. Open a bunch of files (by double clicking them on the project
explorer). Open so many that they don't all fit on the tab bar.
    - Lets say that you had opened the files named A.txt, B.txt,
C.txt, D.txt ... Z.txt, in that order (i.e. the last one you open was
Z.txt, the second to last was Y.txt, etc).
2. At this point, the last (right most) file, Z.txt should be the
active file, and its tab would be visible and active at the very right
of the tab bar.
3. Click the "Close tab" button on the tab bar (then one with a red
minus sign on top of a tab icon).
4. At this point, the active file (the one whose contents are shown by
PyScripter) would be Y.txt. However, its tab will NOT be visible.
Instead the tab that will be visible (but unselected) at the rightmost
side of the tab bar will be X.txt!

So it seems that there is a mistake in the code that selects the
visible tabs. It seems there is a -1 offset error when calculating the
index of the tabs that must be shown after closing a tab. Perhaps that
index is calculated after the tab is closed when it should be
calculated before (or vice-versa)?

Original comment by angel.ez...@gmail.com on 6 Jun 2011 at 6:24

GoogleCodeExporter commented 9 years ago
OK.  I forgot about that close button!  I will now fix that as well.

Original comment by pyscripter on 6 Jun 2011 at 7:25

GoogleCodeExporter commented 9 years ago
Cool! Let me know when you have a new version to test.

By the way, while testing this problem I've used the "Select file" tab
list button a lot. In doing so I realized that I don't think showing
_all_ the tabs when the "Select list" button is clicked is a good
idea. Instead it'd be much better to only show the tabs that are
hidden (i.e. those that are not shown on the visible tab bar). The
reason is that the tab list is sorted alphabetically, which results in
the visible tabs being mixed with the hidden tabs which is a bit
confusing.

Thus I'd be great if at least there was an option to only show the
hidden tabs in the tab list. It may also be nice to have a way to tell
PyScripter to show the files in their tab order, rather than
alphabetically.

Original comment by angel.ez...@gmail.com on 6 Jun 2011 at 7:47

GoogleCodeExporter commented 9 years ago
Could you please test the new download.

Original comment by pyscripter on 6 Jun 2011 at 11:56

GoogleCodeExporter commented 9 years ago
Fantastic! This seems to work great! Thanks!!! :-D

Angel

Original comment by angel.ez...@gmail.com on 7 Jun 2011 at 5:18