From 426b66613cd49497b4e8ad4246031c0e43b2ec27 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Wed, 1 Dec 2010 12:41:11 +0000 Subject: =?UTF-8?q?=E2=80=A2=C2=A0Bundle=20Editor=20:=20ESC=20while=20bund?= =?UTF-8?q?le=20file=20renaming=20aborts=20editing=20=E2=80=A2=20after=20c?= =?UTF-8?q?losing=20HTML=20output=20window=20reset=20windowUUID=20to=20all?= =?UTF-8?q?ow=20to=20come=20up=20with=20a=20new=20window=20for=20the=20sam?= =?UTF-8?q?e=20command=20from=20same=20caller=20instance?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPBundleEditorController.m | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Source/SPBundleEditorController.m') diff --git a/Source/SPBundleEditorController.m b/Source/SPBundleEditorController.m index 4f415416..823feae8 100644 --- a/Source/SPBundleEditorController.m +++ b/Source/SPBundleEditorController.m @@ -1138,6 +1138,23 @@ #pragma mark - #pragma mark TableView delegate +/** + * Traps enter and esc and edit/cancel without entering next row + */ +- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command +{ + if ( [[control window] methodForSelector:command] == [[control window] methodForSelector:@selector(_cancelKey:)] || + [textView methodForSelector:command] == [textView methodForSelector:@selector(complete:)] ) { + + //abort editing + [control abortEditing]; + [[NSApp mainWindow] makeFirstResponder:commandsOutlineView]; + return TRUE; + } else{ + return FALSE; + } +} + - (void)controlTextDidEndEditing:(NSNotification *)aNotification { -- cgit v1.2.3