Skip to content

Commit

Permalink
Saving document if it was edited, without result saving reult check
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulTaykalo committed May 7, 2015
1 parent 710b3b9 commit 469167b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Binary file not shown.
14 changes: 8 additions & 6 deletions Support/Xcode/Source/Classes/SFDYCIHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ - (IDEEditorDocument *)currentDocument
}

- (void)recompileAndInject:(id)sender {

if ([self currentDocument]) {
[[self currentDocument] saveDocument:nil];
if ([[self currentDocument] isDocumentEdited]) {
[[self currentDocument] saveDocumentWithDelegate:self didSaveSelector:@selector(document:didSave:contextInfo:) contextInfo:nil];
} else {
[self recompileAndInjectAfterSave: nil];
}

dispatch_async(dispatch_get_main_queue(), ^{ // This add a little delay for saving, maybe a perform:withDelay will be better ?
[self recompileAndInjectAfterSave: nil];
});
}

- (void)document:(NSDocument *)document didSave:(BOOL)didSaveSuccessfully contextInfo:(void *)contextInfo {
[self recompileAndInjectAfterSave: nil];
}

- (void)recompileAndInjectAfterSave:(id)sender {
Expand Down

0 comments on commit 469167b

Please sign in to comment.