From ec8823e6207f8f68f904968b8c2374a9bad7a776 Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Wed, 30 Mar 2016 23:31:34 +0300 Subject: [PATCH] Cocoa port can now enter an empty line in the debugger to repeat the previous command --- Cocoa/Document.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Cocoa/Document.m b/Cocoa/Document.m index 7ab022f1..d1e20af7 100644 --- a/Cocoa/Document.m +++ b/Cocoa/Document.m @@ -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]];