Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[FIX] Update HTML sibling even if autosave hasn't taken place yet.

  • Loading branch information...
commit 921c71b7dac4ff7aedfa6858b510f84d9187db93 1 parent 1d96a33
Jonathan 'Wolf' Rentzsch authored July 21, 2011

Showing 1 changed file with 9 additions and 3 deletions. Show diff stats Hide diff stats

  1. 12  MyDocument.m
12  MyDocument.m
@@ -78,8 +78,13 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)controller_ {
78 78
 	[super windowControllerDidLoadNib:controller_];
79 79
 }
80 80
 
81  
-- (BOOL)writeToURL:(NSURL*)absoluteURL_ ofType:(NSString*)typeName_ error:(NSError**)error_ {
82  
-	BOOL result = NO;
  81
+- (BOOL)writeToURL:(NSURL*)absoluteURL_
  82
+    ofType:(NSString*)typeName_
  83
+    forSaveOperation:(NSSaveOperationType)saveOperation_
  84
+    originalContentsURL:(NSURL*)absoluteOriginalContentsURL_
  85
+    error:(NSError **)error_
  86
+{
  87
+    BOOL result = NO;
83 88
 	if ([typeName_ isEqualToString:kMarkdownDocumentType]) {
84 89
 		[markdownSourceTextView breakUndoCoalescing];
85 90
 		result = [[markdownSource string] writeToURL:absoluteURL_
@@ -88,7 +93,8 @@ - (BOOL)writeToURL:(NSURL*)absoluteURL_ ofType:(NSString*)typeName_ error:(NSErr
88 93
 											   error:error_];
89 94
 		
90 95
 	}
91  
-    if (result && ![self hasUnautosavedChanges]) {
  96
+    
  97
+    if (result && saveOperation_ != NSAutosaveOperation) {
92 98
         NSURL *markdownFileURL = [self fileURL];
93 99
         NSURL *htmlFileURL = [[markdownFileURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"html"];
94 100
         if ([[NSFileManager defaultManager] fileExistsAtPath:[htmlFileURL path]]) {

0 notes on commit 921c71b

Please sign in to comment.
Something went wrong with that request. Please try again.