Skip to content

Commit a60d4e2

Browse files
Auto-select name for editing when creating new files/folders (#2029)
When creating a new file or folder in the project navigator, the name field should automatically be selected for editing, matching standard macOS UX expectations and Finder behavior. The newFileFromClipboard() function already had this behavior by calling renameFile() at the end. Applied the same pattern to newFile() and newFolder(). Fixes #2029
1 parent 8c05355 commit a60d4e2

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)