@@ -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 ];
@@ -773,7 +777,11 @@ - (NSRect)firstRectForCharacterRange:(NSRange)range
773777 rect.origin .y += rect.size .height ;
774778
775779 rect.origin = [textView convertPoint: rect.origin toView: nil ];
780+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
781+ rect = [[textView window ] convertRectToScreen: rect];
782+ #else
776783 rect.origin = [[textView window ] convertBaseToScreen: rect.origin];
784+ #endif
777785
778786 return rect;
779787}
@@ -1117,9 +1125,13 @@ - (BOOL)inputManagerHandleMouseEvent:(NSEvent *)event
11171125 // the Kotoeri manager "commits" the text on left clicks).
11181126
11191127 if (event) {
1128+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
1129+ return [[NSTextInputContext currentInputContext ] handleEvent: event];
1130+ #else
11201131 NSInputManager *imgr = [NSInputManager currentInputManager ];
11211132 if ([imgr wantsToHandleMouseEvents ])
11221133 return [imgr handleMouseEvent: event];
1134+ #endif
11231135 }
11241136
11251137 return NO ;
@@ -1152,7 +1164,11 @@ - (void)abandonMarkedText
11521164 // that the marked text should be abandoned. (If pos is set to 0 Vim will
11531165 // send backspace sequences to delete the old marked text.)
11541166 [self sendMarkedText: nil position: -1 ];
1167+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
1168+ [[NSTextInputContext currentInputContext ] discardMarkedText ];
1169+ #else
11551170 [[NSInputManager currentInputManager ] markedTextAbandoned: self ];
1171+ #endif
11561172}
11571173
11581174#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
0 commit comments