File tree Expand file tree Collapse file tree
src/vs/editor/browser/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -925,6 +925,23 @@ export class MouseTargetFactory {
925925 }
926926 }
927927
928+ // For inline decorations, Gecko returns the `<span>` of the line and the offset is the `<span>` with the inline decoration
929+ if ( hitResult . offsetNode . nodeType === hitResult . offsetNode . ELEMENT_NODE ) {
930+ const parent1 = hitResult . offsetNode . parentNode ; // expected to be the view line div
931+ const parent1ClassName = parent1 && parent1 . nodeType === parent1 . ELEMENT_NODE ? ( < HTMLElement > parent1 ) . className : null ;
932+
933+ if ( parent1ClassName === ViewLine . CLASS_NAME ) {
934+ const tokenSpan = hitResult . offsetNode . childNodes [ Math . min ( hitResult . offset , hitResult . offsetNode . childNodes . length - 1 ) ] ;
935+ if ( tokenSpan ) {
936+ const p = ctx . getPositionFromDOMInfo ( < HTMLElement > tokenSpan , 0 ) ;
937+ return {
938+ position : p ,
939+ hitTarget : null
940+ } ;
941+ }
942+ }
943+ }
944+
928945 return {
929946 position : null ,
930947 hitTarget : < HTMLElement > hitResult . offsetNode
You can’t perform that action at this time.
0 commit comments