Merge branch 'bug-125' 1.0.1
authorRobert Sesek <rsesek@bluestatic.org>
Mon, 23 Jun 2008 13:45:46 +0000 (09:45 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Mon, 23 Jun 2008 13:45:46 +0000 (09:45 -0400)
Conflicts:

Source/BSSourceView.m

1  2 
Source/BSSourceView.m
Source/BreakpointWindowController.m

index e5d2552f9b06856e3b993b91e680862366900f0f,554794cc0254eb86c57bc0f642c6be4d7dbfb164..70ced9af95b8c7b43329b2a9fce146b8cd7c33fa
   */
  - (void)setFile:(NSString *)f
  {
-       file = f;
+       [file release];
+       file = [f retain];
 -      [textView setString:[NSString stringWithContentsOfFile:f]];
 +
 +      @try
 +      {
 +              // Attempt to use the PHP CLI to highlight the source file as HTML
 +              NSPipe* pipe = [NSPipe pipe];
 +              NSTask* task = [NSTask new];
 +              [task setLaunchPath:@"/usr/bin/php"]; // This is the path to the default Leopard PHP executable
 +              [task setArguments:[NSArray arrayWithObjects:@"-s", f, nil]];
 +              [task setStandardOutput:pipe];
 +              [task launch];
 +              NSData* data               = [[pipe fileHandleForReading] readDataToEndOfFile];
 +              NSAttributedString* source = [[NSAttributedString alloc] initWithHTML:data documentAttributes:NULL];
 +              [[textView textStorage] setAttributedString:source];
 +      }
-       @catch(NSException* exception)
++      @catch (NSException* exception)
 +      {
 +              // If the PHP executable is not available then the NSTask will throw an exception
 +              [textView setString:[NSString stringWithContentsOfFile:f]];
 +      }
  }
  
  /**
Simple merge