From d0aa271e7a6ddf8d47bbbf3942a0bc5a685fe1e8 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Tue, 14 Aug 2007 16:42:10 +0000 Subject: [PATCH] Shift-tab no longer treated as Ctrl-Y (fixes Ctrl-Y bug) git-svn-id: http://macvim.googlecode.com/svn/trunk@136 96c4425d-ca35-0410-94e5-3396d5c13a8f --- MMTextView.m | 11 ++++++++--- SpecialKeys.plist | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/MMTextView.m b/MMTextView.m index 1a973314d2..22e7f7d7a4 100644 --- a/MMTextView.m +++ b/MMTextView.m @@ -428,8 +428,6 @@ if ([event type] != NSKeyDown) return; - //NSLog(@"%s%@", _cmd, event); - NSString *chars = [event characters]; NSString *imchars = [event charactersIgnoringModifiers]; unichar c = [chars characterAtIndex:0]; @@ -437,6 +435,8 @@ int len = 0; const char *bytes = 0; + //NSLog(@"%s chars=0x%x unmodchars=0x%x", _cmd, c, imc); + if (' ' == imc && 0xa0 != c) { // HACK! The AppKit turns into which is not standard // Vim behaviour, so bypass this problem. (0xa0 is , which @@ -451,7 +451,12 @@ // HACK! Translate Ctrl+6 to . static char ctrl_hat = 0x1e; len = 1; bytes = &ctrl_hat; - } else { + } else if (c == 0x19 && imc == 0x19) { + // HACK! AppKit turns back tab into Ctrl-Y, so we need to handle it + // separately (else Ctrl-Y doesn't work). + static char back_tab[2] = { 'k', 'B' }; + len = 2; bytes = back_tab; + }else { len = [chars lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; bytes = [chars UTF8String]; } diff --git a/SpecialKeys.plist b/SpecialKeys.plist index 8d91cccc37..ce89630cdf 100644 --- a/SpecialKeys.plist +++ b/SpecialKeys.plist @@ -4,7 +4,7 @@  KA -  + kB kB  kb