From b72aeb52d4857c24ca74348ad5448088569af813 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Fri, 13 Mar 2009 22:35:12 +0100 Subject: [PATCH] Fix regression This fixes a regression introduced with commmit c79be7f927aff8b2b52a6d8d917b899154ab0ff9 where Ctrl+Unprintable key presses could no longer be mapped to. --- src/MacVim/MMTextViewHelper.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/MacVim/MMTextViewHelper.m b/src/MacVim/MMTextViewHelper.m index 9e4272ff..f2930052 100644 --- a/src/MacVim/MMTextViewHelper.m +++ b/src/MacVim/MMTextViewHelper.m @@ -102,8 +102,14 @@ static float MMDragAreaSize = 73.0f; int flags = [event modifierFlags]; if ((flags & NSControlKeyMask) || ((flags & NSAlternateKeyMask) && (flags & NSFunctionKeyMask))) { + BOOL unmodIsPrintable = YES; + NSString *unmod = [event charactersIgnoringModifiers]; + if (unmod && [unmod length] > 0 && [unmod characterAtIndex:0] < 0x20) + unmodIsPrintable = NO; + NSString *chars = [event characters]; - if ([chars length] == 1 && [chars characterAtIndex:0] < 0x20) { + if ([chars length] == 1 && [chars characterAtIndex:0] < 0x20 + && unmodIsPrintable) { // HACK! Send unprintable characters (such as C-@, C-[, C-\, C-], // C-^, C-_) as normal text to be added to the Vim input buffer. // This must be done in order for the backend to be able to -- 2.11.4.GIT