From 68e5dc4041f5d3a6302697ef2ad10111a1f808d4 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sat, 28 Jun 2008 18:07:47 +0200 Subject: [PATCH] Only show proxy icon if file being edited exists --- src/MacVim/MMWindowController.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 3749061113..c7a86e79df 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -313,8 +313,15 @@ - (void)setDocumentFilename:(NSString *)filename { - if (filename) - [decoratedWindow setRepresentedFilename:filename]; + if (!filename) + return; + + // Ensure file really exists or the path to the proxy icon will look weird. + // If the file does not exists, don't show a proxy icon. + if (![[NSFileManager defaultManager] fileExistsAtPath:filename]) + filename = @""; + + [decoratedWindow setRepresentedFilename:filename]; } - (void)setToolbar:(NSToolbar *)toolbar