summaryrefslogtreecommitdiff
path: root/tikzit/src/osx
diff options
context:
space:
mode:
authorakissinger <akissinger@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-03-01 13:16:44 +0000
committerakissinger <akissinger@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64>2012-03-01 13:16:44 +0000
commit2ce4b8a878459ed8c4b9f3077b9c8f924c2a04e4 (patch)
tree42cd64373756c3f564ec69d2888293e75c8e7051 /tikzit/src/osx
parenta6dda653a33869b446d3fd5f34f35ab7b6836382 (diff)
(osx) fixed bug where preview would hang on too much output
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@417 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'tikzit/src/osx')
-rw-r--r--tikzit/src/osx/PreviewController.m11
1 files changed, 7 insertions, 4 deletions
diff --git a/tikzit/src/osx/PreviewController.m b/tikzit/src/osx/PreviewController.m
index bd43c41..76c5ced 100644
--- a/tikzit/src/osx/PreviewController.m
+++ b/tikzit/src/osx/PreviewController.m
@@ -70,8 +70,10 @@ static PreviewController *preview = nil;
[NSString stringWithFormat:
@"if [ -e ~/.profile ]; then source ~/.profile; fi\n"
@"if [ -e ~/.bashrc ]; then source ~/.bashrc; fi\n"
- @"pdflatex -interaction=nonstopmode -halt-on-error '%@'\n",
+ @"pdflatex -interaction=nonstopmode -output-format=pdf -halt-on-error '%@'\n",
texFile];
+
+ //NSLog(@"Telling bash: %@", latexCmd);
NSPipe *pout = [NSPipe pipe];
NSPipe *pin = [NSPipe pipe];
@@ -84,18 +86,19 @@ static PreviewController *preview = nil;
[latexTask launch];
[latexIn writeData:[latexCmd dataUsingEncoding:NSUTF8StringEncoding]];
[latexIn closeFile];
- [latexTask waitUntilExit];
+
NSData *data = [latexOut readDataToEndOfFile];
NSString *str = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];
+ [latexTask waitUntilExit];
if ([latexTask terminationStatus] != 0) {
[errorTextView setHidden:YES];
- errorText.string = [@"\nAN ERROR HAS OCCURRED, PDFLATEX SAID:\n\n" stringByAppendingString:str];
+ [errorText setString:[@"\nAN ERROR HAS OCCURRED, PDFLATEX SAID:\n\n" stringByAppendingString:str]];
[errorTextView setHidden:NO];
} else {
- errorText.string = @"";
+ [errorText setString:@""];
[errorTextView setHidden:YES];
data = [NSData dataWithContentsOfFile:pdfFile];