mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-04-25 03:11:01 +00:00
Try to add notifications so that editor changes appropriately
This commit is contained in:
parent
41e33c7d54
commit
d283fd04b1
3 changed files with 29 additions and 0 deletions
|
@ -425,6 +425,7 @@
|
|||
[debugger setLastFileNameParsed: nil];
|
||||
[debugger setLastLineNumberParsed: NSNotFound];
|
||||
}
|
||||
[debugger updateEditor];
|
||||
}
|
||||
}
|
||||
return PCDBAsyncStatusRecord;
|
||||
|
|
|
@ -59,6 +59,7 @@ NSString *PCBreakMethod = @"BreakMethod";
|
|||
NSString *PCBreakFilename = @"BreakFilename";
|
||||
NSString *PCBreakLineNumber = @"BreakLineNumber";
|
||||
NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification";
|
||||
NSString *PCUpdateEditorNotification = @"PCUpdateEditorNotification";
|
||||
|
||||
@implementation PCDebugger
|
||||
+ (void) initialize
|
||||
|
@ -305,6 +306,15 @@ NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification";
|
|||
lastLineNumberParsed = num;
|
||||
}
|
||||
|
||||
- (void) updateEditor
|
||||
{
|
||||
NSNumber *n = [NSNumber numberWithInteger: lastLineNumberParsed];
|
||||
NSDictionary *d = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
lastFileNameParsed, @"LastFileName", n, @"LastLineNumber", nil];
|
||||
[NOTIFICATION_CENTER postNotificationName: PCUpdateEditorNotification
|
||||
object: d];
|
||||
}
|
||||
|
||||
// kill process
|
||||
- (void) interrupt
|
||||
{
|
||||
|
|
|
@ -225,6 +225,12 @@
|
|||
highlited_chars[1] = -1;
|
||||
|
||||
undoManager = [[NSUndoManager alloc] init];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver: self
|
||||
selector: @selector(processNotification:)
|
||||
name: @"PCUpdateEditorNotification"
|
||||
object: nil];
|
||||
|
||||
}
|
||||
|
||||
return self;
|
||||
|
@ -410,6 +416,18 @@
|
|||
object:self];
|
||||
}
|
||||
|
||||
- (void) processNotification: (NSNotification *)notification
|
||||
{
|
||||
NSDictionary *d = [notification object];
|
||||
NSString *fileName = [d objectForKey: @"lastFileName"];
|
||||
NSNumber *line = [d objectForKey: @"lastLineNumber"];
|
||||
NSUInteger l = [line integerValue];
|
||||
[self openFileAtPath: fileName
|
||||
editorManager: _editorManager
|
||||
editable: YES];
|
||||
[self scrollToLineNumber: l];
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
// ==== CodeEditor protocol
|
||||
// ===========================================================================
|
||||
|
|
Loading…
Reference in a new issue