From aa77a425fa27d9346986c0787c1504eea0d4683b Mon Sep 17 00:00:00 2001 From: wlux Date: Thu, 5 Nov 2009 22:41:45 +0000 Subject: [PATCH] Enable Ctrl-l keybinding and add Ctrl-o keybinding as in Emacs and Cocoa. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28961 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ KeyBindings/DefaultKeyBindings.dict | 3 ++- Source/NSTextView_actions.m | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5846446b7..aae73e106 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-11-05 Wolfgang Lux + * KeyBindings/DefaultKeyBindings.dict: Enable Ctrl-l key binding + and add Ctrl-o key binding as in Emacs and Cocoa. + * Source/NSTextView_actions.m (-insertNewlineIgnoringFieldEditor:, + -insertTabIgnoringFieldEditor): Implement NSResponder methods. + * Source/NSWindow.m (-dealloc): Release the toolbar without updating the window's geometry and thus avoid calling the delegate during deallocation. diff --git a/KeyBindings/DefaultKeyBindings.dict b/KeyBindings/DefaultKeyBindings.dict index 9360222b6..82af559a2 100644 --- a/KeyBindings/DefaultKeyBindings.dict +++ b/KeyBindings/DefaultKeyBindings.dict @@ -62,9 +62,10 @@ "Control-e" = "moveToEndOfLine:"; "Control-f" = "moveForward:"; "Control-h" = "deleteBackward:"; - /* "Control-l" = "centerSelectionInVisibleArea:"; */ + "Control-l" = "centerSelectionInVisibleArea:"; "Control-k" = "deleteToEndOfLine:"; "Control-n" = "moveDown:"; + "Control-o" = ( "insertNewlineIgnoringFieldEditor:", "moveBackward:" ); "Control-p" = "moveUp:"; "Control-t" = "transpose:"; "Control-v" = "pageDown:"; diff --git a/Source/NSTextView_actions.m b/Source/NSTextView_actions.m index c5b07467b..b9f3450c0 100644 --- a/Source/NSTextView_actions.m +++ b/Source/NSTextView_actions.m @@ -548,6 +548,16 @@ static NSNumber *float_plus_one(NSNumber *cur) //[self insertText: @"\t"]; } +- (void) insertNewlineIgnoringFieldEditor: (id)sender +{ + [self insertText: @"\n"]; +} + +- (void) insertTabIgnoringFieldEditor: (id)sender +{ + [self insertText: @"\t"]; +} + - (void) deleteForward: (id)sender {