Menu

#2347 [SciTE] tabbar not refresh after close file

Bug
closed-fixed
nobody
5
2023-11-04
2022-08-31
twu2
No

version: SciTE 5.3.0 Windows

steps to reproduce:

  1. open lots files in SciTE
  2. move to last (right side) file
  3. close file (ctrl-w or from menu) one by one until tabbar disappear like attachment.
1 Attachments

Discussion

  • Neil Hodgson

    Neil Hodgson - 2022-08-31
    • status: open --> open-works-for-me
     
  • Neil Hodgson

    Neil Hodgson - 2022-08-31

    I can't reproduce this on Windows 10 with SciTE 5.3.0.

     
  • twu2

    twu2 - 2022-09-01

    I found it's more easy to get this by passing files to scite via argument.

    I made a screen recording video as attachment (using scite from a fresh copy extract from wscite530.zip).

    1. execute scite.exe, then open a*.properties, then close it one by one, this work fine.
    2. execute scite.exe with argument to open the same files, then close it one by one. this not work.
     
  • Neil Hodgson

    Neil Hodgson - 2022-09-01

    Was able to reproduce it with command line files. This appears to be caused by [bd8824] which optimized tab bar to reduce flashing and improve performance. Before this change, the tab bar would be cleared and repopulated whenever a tab was added or removed.

    Its strange that this doesn't occur when the files are loaded with the File | Open dialog or through loading a session which appear to perform exactly the same operations.

     

    Related

    Commit: [bd8824]

  • Neil Hodgson

    Neil Hodgson - 2022-09-02
    • status: open-works-for-me --> open-accepted
     
  • twu2

    twu2 - 2023-10-05

    Here is my dirty fix for this.
    After delete the last tab, delete current last tab control and insert it again. (it's strange, but it seems fix this bug)

    diff -Nur scite.orig/scite/win32/SciTEWinBar.cxx scite/scite/win32/SciTEWinBar.cxx
    --- scite.orig/scite/win32/SciTEWinBar.cxx      2023-10-05 13:15:29.720732375 +0800
    +++ scite/scite/win32/SciTEWinBar.cxx   2023-10-05 13:18:36.111393674 +0800
    @@ -103,10 +103,24 @@
    
            // Avoiding drawing with WM_SETREDRAW here does not improve speed or flashing.
    
    
    +       size_t tabDeleted = 0;
            while (tabNames.size() < tabNamesCurrent.size()) {
                    // Remove extra tabs
                    TabCtrl_DeleteItem(HwndOf(wTabBar), tabChange);
                    tabNamesCurrent.erase(tabNamesCurrent.begin() + tabChange);
    +               tabDeleted++;
    +       }
    +       // dirty fix for bug 2347
    +       if (tabDeleted > 0 && tabChange > 0 && tabChange == tabNames.size()) {
    +               // already delete last tab, try to delete and insert the current last tab
    +               TabCtrl_DeleteItem(HwndOf(wTabBar), tabChange - 1);
    +
    +               GUI::gui_string tabNameNext = tabNames.at(tabChange - 1);
    +               TCITEMW tie {};
    +               tie.mask = TCIF_TEXT | TCIF_IMAGE;
    +               tie.iImage = -1;
    +               tie.pszText = tabNameNext.data();
    +               TabCtrl_InsertItem(HwndOf(wTabBar), tabChange - 1, &tie);
            }
    
            while (tabNames.size() > tabNamesCurrent.size()) {
    
     
  • Neil Hodgson

    Neil Hodgson - 2023-10-05
    • status: open-accepted --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2023-10-05

    Committed with [07929c].

     

    Related

    Commit: [07929c]

  • Neil Hodgson

    Neil Hodgson - 2023-11-04
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB