Skip to content

fix: Auto-select name for editing when creating new files/folders#2166

Open
William-Laverty wants to merge 2 commits intoCodeEditApp:mainfrom
William-Laverty:fix/auto-rename-new-files
Open

fix: Auto-select name for editing when creating new files/folders#2166
William-Laverty wants to merge 2 commits intoCodeEditApp:mainfrom
William-Laverty:fix/auto-rename-new-files

Conversation

@William-Laverty
Copy link

Summary

When creating a new file or folder via the project navigator context menu, the name is now automatically selected for editing — matching the behavior already present in "New File from Clipboard" and standard IDE conventions (Xcode, VS Code).

Problem

Creating a new file ("New File...") or folder ("New Folder") would create an item named "untitled" but not enter rename mode, requiring the user to manually right-click → Rename or double-click to change the name.

Fix

Added renameFile() calls in newFile() and newFolder() after the item is created and highlighted, consistent with the existing newFileFromClipboard() implementation.

Changes

  • ProjectNavigatorMenuActions.swift: Call renameFile() after creating new files and folders

Fixes #2029

Implements a recently-closed tab stack on the Editor model. When a tab is
closed, its file reference is pushed onto the stack (up to 20 entries).
Pressing ⇧⌘T (Shift+Command+T) pops the most recently closed tab and
reopens it in the active editor.

Changes:
- Editor: Add recentlyClosedTabs stack, addToRecentlyClosed(), reopenClosedTab()
- CodeEditWindowController: Add reopenClosedTab(_:) action
- FileCommands: Add 'Reopen Closed Tab' menu item with ⇧⌘T shortcut

Closes CodeEditApp#1656
When creating a new file or folder via the project navigator context menu,
the name is now automatically selected for editing (matching the behavior
already present in 'New File from Clipboard').

This matches standard IDE behavior where newly created items immediately
enter rename mode, allowing the user to type a custom name without an
extra step.

Fixes CodeEditApp#2029
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.

🐞 Name Not Selected for Editing When Creating New Files or Folders in Project Navigator

1 participant