Fix centering issue

This commit is contained in:
Gregory John Casamento 2021-08-03 18:48:00 -04:00
parent 87988f435c
commit 736093b0c1
3 changed files with 8 additions and 21 deletions

View file

@ -99,15 +99,6 @@ NSString *PCEditorDidResignActiveNotification =
selector:@selector(editorDidChangeFileName:)
name:PCEditorDidChangeFileNameNotification
object:nil];
// Debugger
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(debuggerDidHitBreakpoint:)
name:PCProjectBreakpointNotification
object:nil];
// Preferences
}
return self;
@ -544,18 +535,6 @@ NSString *PCEditorDidResignActiveNotification =
[_editorsDict setObject:_editor forKey:_newFileName];
}
- (void)debuggerDidHitBreakpoint:(NSNotification *)aNotif
{
id object = [aNotif object];
NSString *filePath = [object objectForKey: @"file"];
NSString *line = [object objectForKey: @"line"];
id<CodeEditor> editor = [self openEditorForFile: filePath
editable: YES
windowed: NO];
[self orderFrontEditorForFile:filePath];
[editor scrollToLineNumber: [line integerValue]];
}
- (void)gotoFile: (NSString *)fileName atLine: (NSUInteger)line
{
PCProject *project = [_projectManager rootActiveProject];

View file

@ -184,10 +184,16 @@
NSString *fileName = [filePath lastPathComponent];
BOOL editable = YES;
id<CodeEditor> editor = nil;
NSFileManager *mgr = [NSFileManager defaultManager];
NSLog(@"PCPE: fileName: %@, filePath: %@, project: %@",
fileName, filePath, [activeProject projectName]);
if (![mgr fileExistsAtPath: filePath])
{
return nil;
}
// Determine if file should be opened for read only
if (![_project isEditableFile:fileName])
{

View file

@ -1069,6 +1069,8 @@
{
[_intEditorView goToLineNumber:lineNumber];
[_extEditorView goToLineNumber:lineNumber];
[_intEditorView centerSelectionInVisibleArea: self];
[_extEditorView centerSelectionInVisibleArea: self];
}
@end