File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -475,6 +475,19 @@ export class MouseTargetFactory {
475475
476476 private static _hitTestViewCursor ( ctx : HitTestContext , request : HitTestRequest ) : MouseTarget {
477477
478+ if ( request . target ) {
479+ // Check if we've hit a painted cursor
480+ const lastViewCursorsRenderData = ctx . lastViewCursorsRenderData ;
481+
482+ for ( let i = 0 , len = lastViewCursorsRenderData . length ; i < len ; i ++ ) {
483+ const d = lastViewCursorsRenderData [ i ] ;
484+
485+ if ( request . target === d . domNode ) {
486+ return request . fulfill ( MouseTargetType . CONTENT_TEXT , d . position ) ;
487+ }
488+ }
489+ }
490+
478491 if ( request . isInContentArea ) {
479492 // Edge has a bug when hit-testing the exact position of a cursor,
480493 // instead of returning the correct dom node, it returns the
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { ViewContext } from 'vs/editor/common/view/viewContext';
1313import { IRenderingContext , IRestrictedRenderingContext } from 'vs/editor/common/view/renderingContext' ;
1414
1515export interface IViewCursorRenderData {
16+ domNode : HTMLElement ;
1617 position : Position ;
1718 contentTop : number ;
1819 contentLeft : number ;
@@ -190,6 +191,7 @@ export class ViewCursor {
190191 this . _domNode . setHeight ( this . _lineHeight ) ;
191192
192193 return {
194+ domNode : this . _domNode . domNode ,
193195 position : this . _position ,
194196 contentTop : top ,
195197 contentLeft : this . _renderData . left ,
You can’t perform that action at this time.
0 commit comments