Skip to content

Commit 741067e

Browse files
fix: select name for editing when creating new files or folders
Fixes #2029 When creating a new file or folder via the context menu, the name is now automatically selected for editing. This matches the expected macOS UX behavior where new items can be immediately renamed. Changes: - Added renameFile() call after creating new file in newFile() - Added renameFile() call after creating new folder in newFolder() Note: The newFileFromClipboard() already had this behavior, this makes the other creation methods consistent.
1 parent cec6287 commit 741067e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorMenuActions.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ extension ProjectNavigatorMenu {
9090
if let newFile = try workspace?.workspaceFileManager?.addFile(fileName: "untitled", toFile: item) {
9191
workspace?.listenerModel.highlightedFileItem = newFile
9292
workspace?.editorManager?.openTab(item: newFile)
93+
renameFile()
9394
}
9495
} catch {
9596
let alert = NSAlert(error: error)
@@ -147,6 +148,7 @@ extension ProjectNavigatorMenu {
147148
do {
148149
if let newFolder = try workspace?.workspaceFileManager?.addFolder(folderName: "untitled", toFile: item) {
149150
workspace?.listenerModel.highlightedFileItem = newFolder
151+
renameFile()
150152
}
151153
} catch {
152154
let alert = NSAlert(error: error)

0 commit comments

Comments
 (0)