Skip to content

Commit ceb167b

Browse files
committed
Fix warnings related to NSInputManager.
1 parent 3cdaa48 commit ceb167b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/MacVim/MMTextViewHelper.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,11 @@ - (void)scrollWheel:(NSEvent *)event
340340
// marked text moves outside the view as a result of scrolling.
341341
[self sendMarkedText:nil position:0];
342342
[self unmarkText];
343+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
344+
[[NSTextInputContext currentInputContext] discardMarkedText];
345+
#else
343346
[[NSInputManager currentInputManager] markedTextAbandoned:self];
347+
#endif
344348
}
345349

346350
float dx = [event deltaX];
@@ -1117,9 +1121,13 @@ - (BOOL)inputManagerHandleMouseEvent:(NSEvent *)event
11171121
// the Kotoeri manager "commits" the text on left clicks).
11181122

11191123
if (event) {
1124+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
1125+
return [[NSTextInputContext currentInputContext] handleEvent:event];
1126+
#else
11201127
NSInputManager *imgr = [NSInputManager currentInputManager];
11211128
if ([imgr wantsToHandleMouseEvents])
11221129
return [imgr handleMouseEvent:event];
1130+
#endif
11231131
}
11241132

11251133
return NO;
@@ -1152,7 +1160,11 @@ - (void)abandonMarkedText
11521160
// that the marked text should be abandoned. (If pos is set to 0 Vim will
11531161
// send backspace sequences to delete the old marked text.)
11541162
[self sendMarkedText:nil position:-1];
1163+
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
1164+
[[NSTextInputContext currentInputContext] discardMarkedText];
1165+
#else
11551166
[[NSInputManager currentInputManager] markedTextAbandoned:self];
1167+
#endif
11561168
}
11571169

11581170
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)

0 commit comments

Comments
 (0)