mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Fixed out of range exception in insertText:
git-svn-id: http://macvim.googlecode.com/svn/trunk@150 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
+11
-12
@@ -57,20 +57,19 @@
|
||||
// modifiers are already included and should not be added to the input
|
||||
// buffer using CSI, K_MODIFIER).
|
||||
|
||||
//NSLog(@"%s%@ (%x)", _cmd, string, [string characterAtIndex:0]);
|
||||
|
||||
NSEvent *event = [NSApp currentEvent];
|
||||
if ([event type] == NSKeyDown) {
|
||||
unsigned mods = [event modifierFlags];
|
||||
unichar c = [[event charactersIgnoringModifiers] characterAtIndex:0];
|
||||
//NSLog(@"%s%@ (event=%@)", _cmd, string, event);
|
||||
|
||||
if (mods & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask)
|
||||
&& ' ' == c) {
|
||||
// HACK! In order to be able to bind to <S-Space> etc. we have to
|
||||
// watch for when space was pressed.
|
||||
[self dispatchKeyEvent:event];
|
||||
return;
|
||||
}
|
||||
// HACK! In order to be able to bind to <S-Space> etc. we have to watch
|
||||
// for when space was pressed.
|
||||
if ([event type] == NSKeyDown
|
||||
&& [[event charactersIgnoringModifiers] length] > 0
|
||||
&& [[event charactersIgnoringModifiers] characterAtIndex:0] == ' '
|
||||
&& [event modifierFlags]
|
||||
& (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask))
|
||||
{
|
||||
[self dispatchKeyEvent:event];
|
||||
return;
|
||||
}
|
||||
|
||||
[NSCursor setHiddenUntilMouseMoves:YES];
|
||||
|
||||
Reference in New Issue
Block a user