mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-04-25 11:20:58 +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 setLastFileNameParsed: nil];
|
||||||
[debugger setLastLineNumberParsed: NSNotFound];
|
[debugger setLastLineNumberParsed: NSNotFound];
|
||||||
}
|
}
|
||||||
|
[debugger updateEditor];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return PCDBAsyncStatusRecord;
|
return PCDBAsyncStatusRecord;
|
||||||
|
|
|
@ -59,6 +59,7 @@ NSString *PCBreakMethod = @"BreakMethod";
|
||||||
NSString *PCBreakFilename = @"BreakFilename";
|
NSString *PCBreakFilename = @"BreakFilename";
|
||||||
NSString *PCBreakLineNumber = @"BreakLineNumber";
|
NSString *PCBreakLineNumber = @"BreakLineNumber";
|
||||||
NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification";
|
NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification";
|
||||||
|
NSString *PCUpdateEditorNotification = @"PCUpdateEditorNotification";
|
||||||
|
|
||||||
@implementation PCDebugger
|
@implementation PCDebugger
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
|
@ -305,6 +306,15 @@ NSString *PCDBDebuggerStartedNotification = @"PCDBDebuggerStartedNotification";
|
||||||
lastLineNumberParsed = num;
|
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
|
// kill process
|
||||||
- (void) interrupt
|
- (void) interrupt
|
||||||
{
|
{
|
||||||
|
|
|
@ -225,6 +225,12 @@
|
||||||
highlited_chars[1] = -1;
|
highlited_chars[1] = -1;
|
||||||
|
|
||||||
undoManager = [[NSUndoManager alloc] init];
|
undoManager = [[NSUndoManager alloc] init];
|
||||||
|
|
||||||
|
[[NSNotificationCenter defaultCenter] addObserver: self
|
||||||
|
selector: @selector(processNotification:)
|
||||||
|
name: @"PCUpdateEditorNotification"
|
||||||
|
object: nil];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -410,6 +416,18 @@
|
||||||
object:self];
|
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
|
// ==== CodeEditor protocol
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
Loading…
Reference in a new issue