File tree Expand file tree Collapse file tree
ICSharpCode.AvalonEdit/Editing Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
191191 if ( ( Keyboard . Modifiers & ModifierKeys . Shift ) == ModifierKeys . Shift ) {
192192 ExtendSelection ( currentSeg ) ;
193193 }
194+ textArea . Caret . BringCaretToView ( 5.0 ) ;
194195 }
195196 }
196197 }
@@ -199,6 +200,7 @@ SimpleSegment GetTextLineSegment(MouseEventArgs e)
199200 {
200201 Point pos = e . GetPosition ( TextView ) ;
201202 pos . X = 0 ;
203+ pos . Y = pos . Y . CoerceValue ( 0 , TextView . ActualHeight ) ;
202204 pos . Y += TextView . VerticalOffset ;
203205 VisualLine vl = TextView . GetVisualLineFromVisualTop ( pos . Y ) ;
204206 if ( vl == null )
@@ -234,6 +236,7 @@ protected override void OnMouseMove(MouseEventArgs e)
234236 if ( currentSeg == SimpleSegment . Invalid )
235237 return ;
236238 ExtendSelection ( currentSeg ) ;
239+ textArea . Caret . BringCaretToView ( 5.0 ) ;
237240 }
238241 base . OnMouseMove ( e ) ;
239242 }
You can’t perform that action at this time.
0 commit comments