- Ctrl-C is passed on to Vim and handled there (does not send SIGINT) - Cmd-. no longer sends SIGINT

git-svn-id: http://macvim.googlecode.com/svn/trunk@175 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
Bjorn Winckler
2007-08-22 15:56:31 +00:00
parent 142bbbf488
commit 6a500c45ba
2 changed files with 11 additions and 20 deletions
+6
View File
@@ -1274,6 +1274,12 @@ static int specialKeyToNSKey(int key);
//NSLog(@"non-special: %@ (hex=%x, mods=%d)", key,
// [key characterAtIndex:0], mods);
if (length == 1 && ((c == Ctrl_C && ctrl_c_interrupts)
|| (c == intr_char && intr_char != Ctrl_C))) {
trash_input_buf();
got_int = TRUE;
}
// HACK! In most circumstances the Ctrl and Shift modifiers should be
// cleared since they are already added to the key by the AppKit.
// Unfortunately, the only way to deal with when to clear the modifiers
+5 -20
View File
@@ -121,21 +121,13 @@
NSString *string = [event charactersIgnoringModifiers];
int flags = [event modifierFlags];
int len = [string lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
NSMutableData *data = [NSMutableData data];
if (len > 0 && [string characterAtIndex:0] == '.') {
// HACK! Intercept Cmd-. and send SIGINT to Vim.
int pid = [[self vimController] pid];
if (pid > 0)
kill(pid, SIGINT);
} else {
NSMutableData *data = [NSMutableData data];
[data appendBytes:&flags length:sizeof(int)];
[data appendBytes:&len length:sizeof(int)];
[data appendBytes:[string UTF8String] length:len];
[data appendBytes:&flags length:sizeof(int)];
[data appendBytes:&len length:sizeof(int)];
[data appendBytes:[string UTF8String] length:len];
[[self vimController] sendMessage:CmdKeyMsgID data:data wait:NO];
}
[[self vimController] sendMessage:CmdKeyMsgID data:data wait:NO];
return YES;
}
@@ -473,13 +465,6 @@
// handle it separately (else Ctrl-C doesn't work).
static char enter[2] = { 'K', 'A' };
len = 2; bytes = enter;
} else if (c == 0x3 && imc == 0x63) {
// HACK! Intercept Ctrl-C and send SIGINT to Vim.
int pid = [[self vimController] pid];
if (pid > 0) {
kill(pid, SIGINT);
return;
}
} else {
len = [chars lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
bytes = [chars UTF8String];