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.
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()) {
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can't reproduce this on Windows 10 with SciTE 5.3.0.
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).
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]
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)
Committed with [07929c].
Related
Commit: [07929c]