diff --git a/MMBackend.m b/MMBackend.m index 7932b5748a..2f503b3388 100644 --- a/MMBackend.m +++ b/MMBackend.m @@ -1089,6 +1089,14 @@ static int specialKeyToNSKey(int key); length = [key lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; unichar c = [key characterAtIndex:0]; + if ((c == Ctrl_C && ctrl_c_interrupts) + || (c == intr_char && intr_char != Ctrl_C)) { + // TODO: The run loop is not touched while Vim is processing, so + // effectively it is impossible to interrupt Vim. + trash_input_buf(); + got_int = TRUE; + } + //NSLog(@"non-special: %@ (hex=%x, mods=%d)", key, // [key characterAtIndex:0], mods); diff --git a/MMTextView.m b/MMTextView.m index 22e7f7d7a4..ee227e4f85 100644 --- a/MMTextView.m +++ b/MMTextView.m @@ -456,7 +456,12 @@ // separately (else Ctrl-Y doesn't work). static char back_tab[2] = { 'k', 'B' }; len = 2; bytes = back_tab; - }else { + } else if (c == 0x3 && imc == 0x3) { + // HACK! AppKit turns enter (not return) into Ctrl-C, so we need to + // handle it separately (else Ctrl-C doesn't work). + static char enter[2] = { 'K', 'A' }; + len = 2; bytes = enter; + } else { len = [chars lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; bytes = [chars UTF8String]; } diff --git a/SpecialKeys.plist b/SpecialKeys.plist index ce89630cdf..c4e0419713 100644 --- a/SpecialKeys.plist +++ b/SpecialKeys.plist @@ -2,7 +2,7 @@ -  + KA KA kB kB