Skip to content

feat: Add ⇧⌘T shortcut to reopen closed tabs#2163

Open
William-Laverty wants to merge 1 commit intoCodeEditApp:mainfrom
William-Laverty:feature/reopen-closed-tabs
Open

feat: Add ⇧⌘T shortcut to reopen closed tabs#2163
William-Laverty wants to merge 1 commit intoCodeEditApp:mainfrom
William-Laverty:feature/reopen-closed-tabs

Conversation

@William-Laverty
Copy link

Summary

Implements #1656

This PR adds the ability to reopen recently closed editor tabs using the ⇧⌘T (Shift+Command+T) keyboard shortcut, a common convention in most editors and browsers.

Changes

  • Add closedTabsHistory to Editor to track recently closed tabs (stores up to 20 tabs)
  • Modify closeTab() to save tabs to the closed history before closing
  • Add reopenLastClosedTab() method to Editor
  • Add canReopenClosedTab computed property for future UI integration
  • Add reopenClosedTab action to CodeEditWindowController
  • Add Reopen Closed Tab menu item to File menu with ⇧⌘T shortcut

Behavior

  • The closed tab history is maintained per-editor (each split view has its own history)
  • Users can repeatedly press ⇧⌘T to reopen multiple tabs in the order they were closed
  • If a file is already open, pressing ⇧⌘T will select it instead of creating a duplicate
  • Maximum of 20 closed tabs are remembered to prevent excessive memory usage

Testing

  1. Open CodeEdit with a workspace
  2. Open several files in tabs
  3. Close some tabs using ⌘W or the close button
  4. Press ⇧⌘T to reopen them in reverse order

Related

Closes #1656

Implements CodeEditApp#1656

This PR adds the ability to reopen recently closed editor tabs using the
⇧⌘T (Shift+Command+T) keyboard shortcut, a common convention in most
editors and browsers.

Changes:
- Add closedTabsHistory to Editor to track recently closed tabs (up to 20)
- Modify closeTab() to save tabs to the closed history before closing
- Add reopenLastClosedTab() method to Editor
- Add reopenClosedTab action to CodeEditWindowController
- Add 'Reopen Closed Tab' menu item to File menu with ⇧⌘T shortcut

The history is per-editor, so each split view maintains its own closed
tab history. Users can repeatedly press ⇧⌘T to reopen multiple tabs
in the order they were closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ ⇧⌘T keyboard shortcut to bring back closed editor tabs

1 participant