Skip to content

Commit

Permalink
FIX: When deleting a file from the project navigator, the alert says …
Browse files Browse the repository at this point in the history
…(Function) in place of the filename (#1492)
  • Loading branch information
tom-ludwig authored Nov 26, 2023
1 parent da2350f commit 5f6551f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CodeEdit/Features/CEWorkspace/Models/CEWorkspaceFile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ final class CEWorkspaceFile: Codable, Comparable, Hashable, Identifiable, Editor
}

/// Returns the file name with optional extension (e.g.: `Package.swift`)
func fileName(typeHidden: Bool) -> String {
func fileName(typeHidden: Bool = false) -> String {
typeHidden ? url.deletingPathExtension().lastPathComponent : name
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ extension CEWorkspaceFileManager {
let deleteConfirmation = NSAlert()
let message: String
if !file.isFolder || file.isEmptyFolder { // if its a file or an empty folder, call it by its name
message = String(describing: file.fileName)
message = file.name
} else {
let childrenCount = try? fileManager.contentsOfDirectory(
at: file.url,
Expand Down

0 comments on commit 5f6551f

Please sign in to comment.