From 19d29d252a62127ff0838ca5f0851b3227948707 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Mon, 27 Aug 2007 18:07:16 +0000 Subject: [PATCH] Update the selected range whenver the cursor position changes. git-svn-id: http://macvim.googlecode.com/svn/trunk@208 96c4425d-ca35-0410-94e5-3396d5c13a8f --- MMTextView.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MMTextView.m b/MMTextView.m index 2ff092279d..931e752ba4 100644 --- a/MMTextView.m +++ b/MMTextView.m @@ -77,6 +77,14 @@ static float MMDragAreaSize = 73.0f; insertionPointShape = shape; insertionPointFraction = percent; + // Update the selected range so that the AppKit knows where the insertion + // point is. (The input manager sometimes likes to popup a window near the + // insertion point.) + MMTextStorage *ts = (MMTextStorage*)[self textStorage]; + unsigned charIdx = [ts characterIndexForRow:insertionPointRow + column:insertionPointColumn]; + [self setSelectedRange:NSMakeRange(charIdx,0)]; + [self setInsertionPointColor:color]; }