Skip to content

Commit

Permalink
Fixed a bug with the non-functional Shift+Cmd+R hotkey. Added the Tab…
Browse files Browse the repository at this point in the history
…s section to the Help.md (#422)
  • Loading branch information
mikekazakov authored Oct 12, 2024
1 parent f86a9ef commit 6b809ea
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
Binary file added Docs/Help-panel-tabs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 22 additions & 1 deletion Docs/Help.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,28 @@ This screenshot shows a `Volumes` Quick List:
![Quick List](Help-panel-quicklist.png)

### Tabs
_to be written_

File panels support a tabbed interface, allowing multiple locations to be opened simultaneously on either the left or right pane. The tab bar appears automatically if more than one tab is open in a pane, but it can also be forced to always show via the menu `View > Show Tab Bar` or by using the hotkey `Cmd + Shift + T`. The screenshot below shows Nimble Commander's window with two tabs in the left pane and three tabs in the right pane:

![Tabbed Interface](Help-panel-tabs.png)

A new tab can be opened in several ways:

- Menu `File > New Tab` or the `Cmd + T` hotkey creates a new tab with the same location.
- Pressing the "+" button next to the tab bar. A long click or right click will display a list of recently closed locations.
- Hitting the `Shift + Cmd + R` hotkey restores the last closed tab and activates it.
- `Alt + Cmd + Return` reveals the currently focused item in a new tab on the opposite pane.

To switch the active tab, the following hotkeys can be used:

- `Shift + Cmd + ]` or `Ctrl + Tab` to switch to the next tab.
- `Shift + Cmd + [` or `Ctrl + Shift + Tab` to switch to the previous tab.
- The `File Panels > Show Tab №1..№10` hotkeys can be assigned to activate a specific tab.

To close tabs, you can use the following hotkeys:

- `Cmd + W` - closes the current tab.
- `Alt + Cmd + W` - closes all other tabs.

### Favorites
_to be written_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,25 @@ - (void)showAddTabMenuForTabView:(NSTabView *)aTabView

- (void)respawnRecentlyClosedCallout:(id)sender
{
if( auto menu_item = nc::objc_cast<NCCommandPopoverItem>(sender) ) {
auto any_holder = nc::objc_cast<AnyHolder>(menu_item.representedObject);
if( !any_holder )
return;
AnyHolder *payload = nil;

if( auto request = std::any_cast<RestoreClosedTabRequest>(&any_holder.any) ) {
const auto tab_view = request->side == RestoreClosedTabRequest::Side::Left
? m_SplitView.leftTabbedHolder.tabView
: m_SplitView.rightTabbedHolder.tabView;
[self spawnNewTabInTabView:tab_view loadingListingPromise:request->promise activateNewPanel:true];
if( m_ClosedPanelsHistory )
m_ClosedPanelsHistory->RemoveListing(request->promise);
}
if( auto popover_item = nc::objc_cast<NCCommandPopoverItem>(sender) ) {
payload = nc::objc_cast<AnyHolder>(popover_item.representedObject);
}
else if( auto menu_item = nc::objc_cast<NSMenuItem>(sender) ) {
payload = nc::objc_cast<AnyHolder>(menu_item.representedObject);
}

if( !payload )
return;

if( auto request = std::any_cast<RestoreClosedTabRequest>(&payload.any) ) {
const auto tab_view = request->side == RestoreClosedTabRequest::Side::Left
? m_SplitView.leftTabbedHolder.tabView
: m_SplitView.rightTabbedHolder.tabView;
[self spawnNewTabInTabView:tab_view loadingListingPromise:request->promise activateNewPanel:true];
if( m_ClosedPanelsHistory )
m_ClosedPanelsHistory->RemoveListing(request->promise);
}
}

Expand Down

0 comments on commit 6b809ea

Please sign in to comment.