Permalink
Browse files

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

  • Loading branch information...
1 parent 1d96a33 commit 921c71b7dac4ff7aedfa6858b510f84d9187db93 @rentzsch committed Jul 22, 2011
Showing with 9 additions and 3 deletions.
  1. +9 −3 MyDocument.m
View
@@ -78,8 +78,13 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)controller_ {
[super windowControllerDidLoadNib:controller_];
}
-- (BOOL)writeToURL:(NSURL*)absoluteURL_ ofType:(NSString*)typeName_ error:(NSError**)error_ {
- BOOL result = NO;
+- (BOOL)writeToURL:(NSURL*)absoluteURL_
+ ofType:(NSString*)typeName_
+ forSaveOperation:(NSSaveOperationType)saveOperation_
+ originalContentsURL:(NSURL*)absoluteOriginalContentsURL_
+ error:(NSError **)error_
+{
+ BOOL result = NO;
if ([typeName_ isEqualToString:kMarkdownDocumentType]) {
[markdownSourceTextView breakUndoCoalescing];
result = [[markdownSource string] writeToURL:absoluteURL_
@@ -88,7 +93,8 @@ - (BOOL)writeToURL:(NSURL*)absoluteURL_ ofType:(NSString*)typeName_ error:(NSErr
error:error_];
}
- if (result && ![self hasUnautosavedChanges]) {
+
+ if (result && saveOperation_ != NSAutosaveOperation) {
NSURL *markdownFileURL = [self fileURL];
NSURL *htmlFileURL = [[markdownFileURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"html"];
if ([[NSFileManager defaultManager] fileExistsAtPath:[htmlFileURL path]]) {

0 comments on commit 921c71b

Please sign in to comment.