Cocoa port can now enter an empty line in the debugger to repeat the previous command

This commit is contained in:
Lior Halphon 2016-03-30 23:31:34 +03:00
parent f1e9623371
commit ec8823e620

View File

@ -10,6 +10,8 @@
reasonable alternative to this. */
unsigned long pendingLogLines;
bool tooMuchLogs;
NSString *lastConsoleInput;
}
@property AudioClient *audioClient;
@ -307,7 +309,13 @@ static uint32_t rgbEncode(GB_gameboy_t *gb, unsigned char r, unsigned char g, un
- (IBAction)consoleInput:(NSTextField *)sender {
NSString *line = [sender stringValue];
if (!line) {
if ([line isEqualToString:@""]) {
line = lastConsoleInput;
}
else if (line) {
lastConsoleInput = line;
}
else {
line = @"";
}
[self log:[line UTF8String]];