You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Close All Others context menu command not closing all others #8855
Is this the same behavior you get when you use the Close All Others command from the menu? (If so, probably not urgent to fix for Juliet Rose; maybe we could remove from the doc tab menu until we have an implementation that works the way people expect)
I tried to determine that when opening this issue, and hit variations in behavior with multiple attempts even within the same entry point (context menu vs. main menu).
Possibly a timing issue and/or focus issue, possibly a subtle order of operations issue, so needs more investigation before I can say. There are some differences in the code paths taken since the main menu command only works on the currently selected tab, whereas the context menu command operates on whichever document tab you right-clicked on, even if it's not the currently selected tab.
FWIW I can consistently reproduce this via the context menu when the last editor with focus is in a different column from the one I'm entering the context menu in.
e.g. If I type in one column, then immediately right-click a tab in another column and select 'Close All Others', all tabs will close.
Since there is one File menu for all columns, I'm not able to reproduce the behavior. It always closes all but the last one with focus.
Investigation note, the problem stems from use of activeColumn_ (below) when checking to see if editor being closed is the one that is supposed to stay open. If document's whose tab was right-clicked is in a different source column than the last active document, then this check will fail and the document will close.
@melissa-barca I didn't want the appearance of our full-blown menus (icons, shortcuts). The column is already available with the existing technique (see the PR).
RStudio Edition : Desktop
RStudio Version : 1.4.1591
OS Version : mac OS 11.2.1
R Version : 4.0.3
Verified that the Close All Others option in the context menu is working as expected with single or multiple source panes open and with or without unsaved documents open. The option was tested in various scenarios when selected from in focus / out of focus documents across multiple source panes.
Activity
jmcphers commentedon Feb 1, 2021
Is this the same behavior you get when you use the Close All Others command from the menu? (If so, probably not urgent to fix for Juliet Rose; maybe we could remove from the doc tab menu until we have an implementation that works the way people expect)
gtritchie commentedon Feb 1, 2021
I tried to determine that when opening this issue, and hit variations in behavior with multiple attempts even within the same entry point (context menu vs. main menu).
Possibly a timing issue and/or focus issue, possibly a subtle order of operations issue, so needs more investigation before I can say. There are some differences in the code paths taken since the main menu command only works on the currently selected tab, whereas the context menu command operates on whichever document tab you right-clicked on, even if it's not the currently selected tab.
melissa-barca commentedon Feb 4, 2021
FWIW I can consistently reproduce this via the context menu when the last editor with focus is in a different column from the one I'm entering the context menu in.
e.g. If I type in one column, then immediately right-click a tab in another column and select 'Close All Others', all tabs will close.
Since there is one File menu for all columns, I'm not able to reproduce the behavior. It always closes all but the last one with focus.
gtritchie commentedon Feb 4, 2021
Investigation note, the problem stems from use of
activeColumn_(below) when checking to see if editor being closed is the one that is supposed to stay open. If document's whose tab was right-clicked is in a different source column than the last active document, then this check will fail and the document will close.rstudio/src/gwt/src/org/rstudio/studio/client/workbench/views/source/SourceColumnManager.java
Line 1483 in 7269605
fix issue with close all other context menu closing everything
melissa-barca commentedon Feb 4, 2021
@gtritchie When you add the items to the menu you'll want to use SourceAppCommands rather than traditional commands and include the column the command is acting on. We have an example of this here: https://github.com/rstudio/rstudio/blob/master/src/gwt/src/org/rstudio/studio/client/workbench/views/source/editors/text/TextEditingTargetWidget.java#L397-L398
gtritchie commentedon Feb 4, 2021
@melissa-barca I didn't want the appearance of our full-blown menus (icons, shortcuts). The column is already available with the existing technique (see the PR).
valerie-rstudio commentedon Feb 24, 2021
Verified Fixed
Verified that the Close All Others option in the context menu is working as expected with single or multiple source panes open and with or without unsaved documents open. The option was tested in various scenarios when selected from in focus / out of focus documents across multiple source panes.