monaco-editor-core 0.54.0 → 0.55.0-dev-20251007

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/esm/nls.messages.de.js +1 -1
  2. package/esm/nls.messages.es.js +1 -1
  3. package/esm/nls.messages.fr.js +1 -1
  4. package/esm/nls.messages.it.js +1 -1
  5. package/esm/nls.messages.ja.js +1 -1
  6. package/esm/nls.messages.ko.js +1 -1
  7. package/esm/nls.messages.ru.js +1 -1
  8. package/esm/nls.messages.zh-cn.js +1 -1
  9. package/esm/nls.messages.zh-tw.js +1 -1
  10. package/esm/vs/base/browser/canIUse.js +1 -0
  11. package/esm/vs/base/browser/canIUse.js.map +1 -1
  12. package/esm/vs/base/browser/dom.js +9 -0
  13. package/esm/vs/base/browser/dom.js.map +1 -1
  14. package/esm/vs/base/browser/fastDomNode.js.map +1 -1
  15. package/esm/vs/base/browser/mouseEvent.js +3 -0
  16. package/esm/vs/base/browser/mouseEvent.js.map +1 -1
  17. package/esm/vs/base/browser/trustedTypes.js +2 -0
  18. package/esm/vs/base/browser/trustedTypes.js.map +1 -1
  19. package/esm/vs/base/browser/ui/list/listWidget.js +5 -5
  20. package/esm/vs/base/browser/ui/list/listWidget.js.map +1 -1
  21. package/esm/vs/base/browser/ui/sash/sash.css +1 -1
  22. package/esm/vs/base/browser/ui/sash/sash.js +4 -0
  23. package/esm/vs/base/browser/ui/sash/sash.js.map +1 -1
  24. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js +1 -1
  25. package/esm/vs/base/browser/ui/scrollbar/scrollableElement.js.map +1 -1
  26. package/esm/vs/base/browser/ui/table/table.css +2 -2
  27. package/esm/vs/base/browser/ui/tree/abstractTree.js +7 -3
  28. package/esm/vs/base/browser/ui/tree/abstractTree.js.map +1 -1
  29. package/esm/vs/base/browser/ui/tree/asyncDataTree.js +4 -0
  30. package/esm/vs/base/browser/ui/tree/asyncDataTree.js.map +1 -1
  31. package/esm/vs/base/browser/ui/tree/indexTreeModel.js +1 -0
  32. package/esm/vs/base/browser/ui/tree/indexTreeModel.js.map +1 -1
  33. package/esm/vs/base/browser/ui/tree/media/tree.css +2 -2
  34. package/esm/vs/base/browser/webWorkerFactory.js +3 -0
  35. package/esm/vs/base/browser/webWorkerFactory.js.map +1 -1
  36. package/esm/vs/base/common/buffer.js.map +1 -1
  37. package/esm/vs/base/common/decorators.js +1 -0
  38. package/esm/vs/base/common/decorators.js.map +1 -1
  39. package/esm/vs/base/common/errors.js +1 -0
  40. package/esm/vs/base/common/errors.js.map +1 -1
  41. package/esm/vs/base/common/glob.js +1 -1
  42. package/esm/vs/base/common/glob.js.map +1 -1
  43. package/esm/vs/base/common/hash.js.map +1 -1
  44. package/esm/vs/base/common/hotReload.js +2 -0
  45. package/esm/vs/base/common/hotReload.js.map +1 -1
  46. package/esm/vs/base/common/hotReloadHelpers.js +1 -0
  47. package/esm/vs/base/common/hotReloadHelpers.js.map +1 -1
  48. package/esm/vs/base/common/lifecycle.js +19 -0
  49. package/esm/vs/base/common/lifecycle.js.map +1 -1
  50. package/esm/vs/base/common/map.js.map +1 -1
  51. package/esm/vs/base/common/marshalling.js +4 -0
  52. package/esm/vs/base/common/marshalling.js.map +1 -1
  53. package/esm/vs/base/common/network.js +1 -0
  54. package/esm/vs/base/common/network.js.map +1 -1
  55. package/esm/vs/base/common/objects.js +1 -0
  56. package/esm/vs/base/common/objects.js.map +1 -1
  57. package/esm/vs/base/common/observableInternal/changeTracker.js +4 -0
  58. package/esm/vs/base/common/observableInternal/changeTracker.js.map +1 -1
  59. package/esm/vs/base/common/observableInternal/debugLocation.js +1 -0
  60. package/esm/vs/base/common/observableInternal/debugLocation.js.map +1 -1
  61. package/esm/vs/base/common/observableInternal/debugName.js +1 -0
  62. package/esm/vs/base/common/observableInternal/debugName.js.map +1 -1
  63. package/esm/vs/base/common/observableInternal/logging/consoleObservableLogger.js +1 -0
  64. package/esm/vs/base/common/observableInternal/logging/consoleObservableLogger.js.map +1 -1
  65. package/esm/vs/base/common/observableInternal/logging/debugger/debuggerRpc.js +1 -0
  66. package/esm/vs/base/common/observableInternal/logging/debugger/debuggerRpc.js.map +1 -1
  67. package/esm/vs/base/common/observableInternal/logging/debugger/rpc.js +1 -0
  68. package/esm/vs/base/common/observableInternal/logging/debugger/rpc.js.map +1 -1
  69. package/esm/vs/base/common/observableInternal/observables/derived.js +7 -1
  70. package/esm/vs/base/common/observableInternal/observables/derived.js.map +1 -1
  71. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js +2 -0
  72. package/esm/vs/base/common/observableInternal/observables/derivedImpl.js.map +1 -1
  73. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js +1 -0
  74. package/esm/vs/base/common/observableInternal/observables/observableFromEvent.js.map +1 -1
  75. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js +1 -0
  76. package/esm/vs/base/common/observableInternal/reactions/autorunImpl.js.map +1 -1
  77. package/esm/vs/base/common/process.js +1 -0
  78. package/esm/vs/base/common/process.js.map +1 -1
  79. package/esm/vs/base/common/product.js.map +1 -1
  80. package/esm/vs/base/common/types.js +2 -0
  81. package/esm/vs/base/common/types.js.map +1 -1
  82. package/esm/vs/base/common/worker/webWorker.js +26 -14
  83. package/esm/vs/base/common/worker/webWorker.js.map +1 -1
  84. package/esm/vs/base/parts/sandbox/common/sandboxTypes.js +2 -0
  85. package/esm/vs/base/parts/sandbox/common/sandboxTypes.js.map +1 -0
  86. package/esm/vs/editor/browser/config/editorConfiguration.js +3 -2
  87. package/esm/vs/editor/browser/config/editorConfiguration.js.map +1 -1
  88. package/esm/vs/editor/browser/config/migrateOptions.js +1 -1
  89. package/esm/vs/editor/browser/config/migrateOptions.js.map +1 -1
  90. package/esm/vs/editor/browser/controller/editContext/native/editContextFactory.js.map +1 -1
  91. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js +2 -0
  92. package/esm/vs/editor/browser/controller/editContext/native/nativeEditContextUtils.js.map +1 -1
  93. package/esm/vs/editor/browser/controller/mouseHandler.js +2 -1
  94. package/esm/vs/editor/browser/controller/mouseHandler.js.map +1 -1
  95. package/esm/vs/editor/browser/controller/mouseTarget.js +7 -0
  96. package/esm/vs/editor/browser/controller/mouseTarget.js.map +1 -1
  97. package/esm/vs/editor/browser/controller/pointerHandler.js.map +1 -1
  98. package/esm/vs/editor/browser/coreCommands.js.map +1 -1
  99. package/esm/vs/editor/browser/editorBrowser.js.map +1 -1
  100. package/esm/vs/editor/browser/editorDom.js.map +1 -1
  101. package/esm/vs/editor/browser/editorExtensions.js.map +1 -1
  102. package/esm/vs/editor/browser/gpu/gpuUtils.js +1 -0
  103. package/esm/vs/editor/browser/gpu/gpuUtils.js.map +1 -1
  104. package/esm/vs/editor/browser/gpu/viewGpuContext.js +1 -0
  105. package/esm/vs/editor/browser/gpu/viewGpuContext.js.map +1 -1
  106. package/esm/vs/editor/browser/services/abstractCodeEditorService.js.map +1 -1
  107. package/esm/vs/editor/browser/services/bulkEditService.js.map +1 -1
  108. package/esm/vs/editor/browser/services/codeEditorService.js.map +1 -1
  109. package/esm/vs/editor/browser/services/editorWorkerService.js.map +1 -1
  110. package/esm/vs/editor/browser/services/hoverService/hover.css +2 -0
  111. package/esm/vs/editor/browser/services/hoverService/hoverService.js.map +1 -1
  112. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js +1 -1
  113. package/esm/vs/editor/browser/services/hoverService/hoverWidget.js.map +1 -1
  114. package/esm/vs/editor/browser/services/inlineCompletionsService.js +8 -8
  115. package/esm/vs/editor/browser/services/inlineCompletionsService.js.map +1 -1
  116. package/esm/vs/editor/browser/services/openerService.js.map +1 -1
  117. package/esm/vs/editor/browser/view/viewLayer.js +1 -1
  118. package/esm/vs/editor/browser/view/viewLayer.js.map +1 -1
  119. package/esm/vs/editor/browser/view.js.map +1 -1
  120. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js +1 -0
  121. package/esm/vs/editor/browser/viewParts/contentWidgets/contentWidgets.js.map +1 -1
  122. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js +1 -0
  123. package/esm/vs/editor/browser/viewParts/viewZones/viewZones.js.map +1 -1
  124. package/esm/vs/editor/browser/widget/codeEditor/codeEditorContributions.js.map +1 -1
  125. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js +4 -1
  126. package/esm/vs/editor/browser/widget/codeEditor/codeEditorWidget.js.map +1 -1
  127. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -0
  128. package/esm/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js.map +1 -1
  129. package/esm/vs/editor/browser/widget/diffEditor/delegatingEditorImpl.js.map +1 -1
  130. package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js +1 -0
  131. package/esm/vs/editor/browser/widget/diffEditor/diffEditorOptions.js.map +1 -1
  132. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js +1 -0
  133. package/esm/vs/editor/browser/widget/diffEditor/diffEditorWidget.js.map +1 -1
  134. package/esm/vs/editor/browser/widget/diffEditor/utils.js +2 -0
  135. package/esm/vs/editor/browser/widget/diffEditor/utils.js.map +1 -1
  136. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js +2 -0
  137. package/esm/vs/editor/browser/widget/multiDiffEditor/diffEditorItemTemplate.js.map +1 -1
  138. package/esm/vs/editor/common/config/editorOptions.js +122 -68
  139. package/esm/vs/editor/common/config/editorOptions.js.map +1 -1
  140. package/esm/vs/editor/common/config/fontInfo.js +32 -16
  141. package/esm/vs/editor/common/config/fontInfo.js.map +1 -1
  142. package/esm/vs/editor/common/config/fontInfoFromSettings.js +16 -0
  143. package/esm/vs/editor/common/config/fontInfoFromSettings.js.map +1 -0
  144. package/esm/vs/editor/common/core/edits/edit.js +1 -0
  145. package/esm/vs/editor/common/core/edits/edit.js.map +1 -1
  146. package/esm/vs/editor/common/core/edits/stringEdit.js +2 -0
  147. package/esm/vs/editor/common/core/edits/stringEdit.js.map +1 -1
  148. package/esm/vs/editor/common/core/position.js +1 -1
  149. package/esm/vs/editor/common/core/position.js.map +1 -1
  150. package/esm/vs/editor/common/core/range.js +1 -1
  151. package/esm/vs/editor/common/core/range.js.map +1 -1
  152. package/esm/vs/editor/common/core/selection.js +1 -1
  153. package/esm/vs/editor/common/core/selection.js.map +1 -1
  154. package/esm/vs/editor/common/cursor/cursorMoveCommands.js.map +1 -1
  155. package/esm/vs/editor/common/editorCommon.js.map +1 -1
  156. package/esm/vs/editor/common/languages.js +1 -1
  157. package/esm/vs/editor/common/languages.js.map +1 -1
  158. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js +14 -0
  159. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.js.map +1 -1
  160. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js +2 -0
  161. package/esm/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/smallImmutableSet.js.map +1 -1
  162. package/esm/vs/editor/common/model/textModel.js +1 -1
  163. package/esm/vs/editor/common/model/textModel.js.map +1 -1
  164. package/esm/vs/editor/common/model.js +1 -1
  165. package/esm/vs/editor/common/model.js.map +1 -1
  166. package/esm/vs/editor/common/services/editorBaseApi.js.map +1 -1
  167. package/esm/vs/editor/common/services/editorWebWorker.js +1 -0
  168. package/esm/vs/editor/common/services/editorWebWorker.js.map +1 -1
  169. package/esm/vs/editor/common/services/editorWorkerHost.js.map +1 -1
  170. package/esm/vs/editor/common/services/modelService.js +14 -21
  171. package/esm/vs/editor/common/services/modelService.js.map +1 -1
  172. package/esm/vs/editor/common/textModelEditSource.js +2 -0
  173. package/esm/vs/editor/common/textModelEditSource.js.map +1 -1
  174. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js +40 -1
  175. package/esm/vs/editor/common/viewLayout/viewLineRenderer.js.map +1 -1
  176. package/esm/vs/editor/common/viewModel/viewModelImpl.js +2 -1
  177. package/esm/vs/editor/common/viewModel/viewModelImpl.js.map +1 -1
  178. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js +1 -1
  179. package/esm/vs/editor/contrib/codeAction/browser/codeActionController.js.map +1 -1
  180. package/esm/vs/editor/contrib/codelens/browser/codelensController.js +1 -1
  181. package/esm/vs/editor/contrib/codelens/browser/codelensController.js.map +1 -1
  182. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js +1 -0
  183. package/esm/vs/editor/contrib/colorPicker/browser/colorDetector.js.map +1 -1
  184. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js +1 -0
  185. package/esm/vs/editor/contrib/contextmenu/browser/contextmenu.js.map +1 -1
  186. package/esm/vs/editor/contrib/find/browser/findModel.js +1 -0
  187. package/esm/vs/editor/contrib/find/browser/findModel.js.map +1 -1
  188. package/esm/vs/editor/contrib/find/browser/findWidget.css +5 -5
  189. package/esm/vs/editor/contrib/folding/browser/folding.css +4 -4
  190. package/esm/vs/editor/contrib/folding/browser/foldingDecorations.js.map +1 -1
  191. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
  192. package/esm/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js.map +1 -1
  193. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js +30 -14
  194. package/esm/vs/editor/contrib/inlayHints/browser/inlayHintsController.js.map +1 -1
  195. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js +4 -3
  196. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js.map +1 -1
  197. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js +56 -7
  198. package/esm/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsSource.js.map +1 -1
  199. package/esm/vs/editor/contrib/inlineCompletions/browser/structuredLogger.js +1 -0
  200. package/esm/vs/editor/contrib/inlineCompletions/browser/structuredLogger.js.map +1 -1
  201. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js +2 -0
  202. package/esm/vs/editor/contrib/inlineCompletions/browser/view/ghostText/ghostTextView.js.map +1 -1
  203. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js +1 -0
  204. package/esm/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/components/gutterIndicatorView.js.map +1 -1
  205. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +1 -1
  206. package/esm/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js.map +1 -1
  207. package/esm/vs/editor/contrib/rename/browser/renameWidget.js.map +1 -1
  208. package/esm/vs/editor/contrib/symbolIcons/browser/symbolIcons.css +2 -0
  209. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +2 -0
  210. package/esm/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js.map +1 -1
  211. package/esm/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js.map +1 -1
  212. package/esm/vs/editor/editor.api.d.ts +8 -8
  213. package/esm/vs/editor/editor.api.js +4 -0
  214. package/esm/vs/editor/editor.api.js.map +1 -1
  215. package/esm/vs/editor/standalone/browser/standaloneCodeEditor.js.map +1 -1
  216. package/esm/vs/editor/standalone/browser/standaloneEditor.js +37 -0
  217. package/esm/vs/editor/standalone/browser/standaloneEditor.js.map +1 -1
  218. package/esm/vs/editor/standalone/browser/standaloneLanguages.js +37 -0
  219. package/esm/vs/editor/standalone/browser/standaloneLanguages.js.map +1 -1
  220. package/esm/vs/editor/standalone/browser/standaloneServices.js.map +1 -1
  221. package/esm/vs/editor/standalone/browser/standaloneWebWorker.js.map +1 -1
  222. package/esm/vs/editor/standalone/common/monarch/monarchCompile.js +3 -0
  223. package/esm/vs/editor/standalone/common/monarch/monarchCompile.js.map +1 -1
  224. package/esm/vs/platform/accessibility/browser/accessibilityService.js +2 -2
  225. package/esm/vs/platform/accessibility/browser/accessibilityService.js.map +1 -1
  226. package/esm/vs/platform/actions/common/actions.js.map +1 -1
  227. package/esm/vs/platform/commands/common/commands.js.map +1 -1
  228. package/esm/vs/platform/contextkey/common/contextkey.js +5 -0
  229. package/esm/vs/platform/contextkey/common/contextkey.js.map +1 -1
  230. package/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js +1 -0
  231. package/esm/vs/platform/dataChannel/browser/forwardingTelemetryService.js.map +1 -1
  232. package/esm/vs/platform/dnd/browser/dnd.js +2 -0
  233. package/esm/vs/platform/dnd/browser/dnd.js.map +1 -1
  234. package/esm/vs/platform/instantiation/common/descriptors.js.map +1 -1
  235. package/esm/vs/platform/instantiation/common/instantiation.js.map +1 -1
  236. package/esm/vs/platform/instantiation/common/instantiationService.js +1 -0
  237. package/esm/vs/platform/instantiation/common/instantiationService.js.map +1 -1
  238. package/esm/vs/platform/list/browser/listService.js +5 -0
  239. package/esm/vs/platform/list/browser/listService.js.map +1 -1
  240. package/esm/vs/platform/log/common/log.js.map +1 -1
  241. package/esm/vs/platform/log/common/logService.js.map +1 -1
  242. package/esm/vs/platform/observable/common/wrapInHotClass.js +2 -0
  243. package/esm/vs/platform/observable/common/wrapInHotClass.js.map +1 -1
  244. package/esm/vs/platform/observable/common/wrapInReloadableClass.js +3 -0
  245. package/esm/vs/platform/observable/common/wrapInReloadableClass.js.map +1 -1
  246. package/esm/vs/platform/product/common/product.js +69 -0
  247. package/esm/vs/platform/product/common/product.js.map +1 -0
  248. package/esm/vs/platform/quickinput/browser/quickInput.js +1 -1
  249. package/esm/vs/platform/quickinput/browser/quickInput.js.map +1 -1
  250. package/monaco.d.ts +8 -8
  251. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/controller/mouseHandler.ts","vs/editor/browser/controller/mouseHandler.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE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,YAAY,CAAC;IAC1C,CAAC;IAEM,uBAAuB,CAAC,oBAA6B;QAC3D,IAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAEM,WAAW,CAAC,iBAAyB,EAAE,oBAA8B;QAC3E,oJAAoJ;QACpJ,MAAM,WAAW,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QAC3C,IAAI,WAAW,GAAG,IAAI,CAAC,0BAA0B,GAAG,cAAc,CAAC,2BAA2B,EAAE,CAAC;YAChG,iBAAiB,GAAG,CAAC,CAAC;QACvB,CAAC;QACD,IAAI,CAAC,0BAA0B,GAAG,WAAW,CAAC;QAE9C,iKAAiK;QACjK,IAAI,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,GAAG,CAAC,EAAE,CAAC;YACtD,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAClD,CAAC;QAED,uEAAuE;QACvE,IAAI,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,CAAC;YAC7F,IAAI,CAAC,gCAAgC,EAAE,CAAC;QACzC,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,gCAAgC,GAAG,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,sBAAsB,GAAG,oBAAoB,CAAC;QAEnD,qCAAqC;QACrC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAC/F,CAAC","file":"mouseHandler.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../base/browser/dom.js';\nimport { StandardWheelEvent, IMouseWheelEvent } from '../../../base/browser/mouseEvent.js';\nimport { Disposable, IDisposable } from '../../../base/common/lifecycle.js';\nimport * as platform from '../../../base/common/platform.js';\nimport { HitTestContext, MouseTarget, MouseTargetFactory, PointerHandlerLastRenderData } from './mouseTarget.js';\nimport { IMouseTarget, IMouseTargetViewZoneData, MouseTargetType } from '../editorBrowser.js';\nimport { ClientCoordinates, EditorMouseEvent, EditorMouseEventFactory, GlobalEditorPointerMoveMonitor, createEditorPagePosition, createCoordinatesRelativeToEditor } from '../editorDom.js';\nimport { ViewController } from '../view/viewController.js';\nimport { EditorZoom } from '../../common/config/editorZoom.js';\nimport { Position } from '../../common/core/position.js';\nimport { Selection } from '../../common/core/selection.js';\nimport { HorizontalPosition } from '../view/renderingContext.js';\nimport { ViewContext } from '../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../common/viewEvents.js';\nimport { ViewEventHandler } from '../../common/viewEventHandler.js';\nimport { EditorOption } from '../../common/config/editorOptions.js';\nimport { NavigationCommandRevealType } from '../coreCommands.js';\nimport { MouseWheelClassifier } from '../../../base/browser/ui/scrollbar/scrollableElement.js';\nimport { ViewLinesGpu } from '../viewParts/viewLinesGpu/viewLinesGpu.js';\nimport { TopBottomDragScrolling, LeftRightDragScrolling } from './dragScrolling.js';\n\nexport interface IPointerHandlerHelper {\n\tviewDomNode: HTMLElement;\n\tlinesContentDomNode: HTMLElement;\n\tviewLinesDomNode: HTMLElement;\n\tviewLinesGpu: ViewLinesGpu | undefined;\n\n\tfocusTextArea(): void;\n\tdispatchTextAreaEvent(event: CustomEvent): void;\n\n\t/**\n\t * Get the last rendered information for cursors & textarea.\n\t */\n\tgetLastRenderData(): PointerHandlerLastRenderData;\n\n\t/**\n\t * Render right now\n\t */\n\trenderNow(): void;\n\n\tshouldSuppressMouseDownOnViewZone(viewZoneId: string): boolean;\n\tshouldSuppressMouseDownOnWidget(widgetId: string): boolean;\n\n\t/**\n\t * Decode a position from a rendered dom node\n\t */\n\tgetPositionFromDOMInfo(spanNode: HTMLElement, offset: number): Position | null;\n\n\tvisibleRangeForPosition(lineNumber: number, column: number): HorizontalPosition | null;\n\tgetLineWidth(lineNumber: number): number;\n}\n\nexport class MouseHandler extends ViewEventHandler {\n\n\tprotected _context: ViewContext;\n\tprotected viewController: ViewController;\n\tprotected viewHelper: IPointerHandlerHelper;\n\tprotected mouseTargetFactory: MouseTargetFactory;\n\tprotected readonly _mouseDownOperation: MouseDownOperation;\n\tprivate lastMouseLeaveTime: number;\n\tprivate _height: number;\n\tprivate _mouseLeaveMonitor: IDisposable | null = null;\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tsuper();\n\n\t\tthis._context = context;\n\t\tthis.viewController = viewController;\n\t\tthis.viewHelper = viewHelper;\n\t\tthis.mouseTargetFactory = new MouseTargetFactory(this._context, viewHelper);\n\n\t\tthis._mouseDownOperation = this._register(new MouseDownOperation(\n\t\t\tthis._context,\n\t\t\tthis.viewController,\n\t\t\tthis.viewHelper,\n\t\t\tthis.mouseTargetFactory,\n\t\t\t(e, testEventTarget) => this._createMouseTarget(e, testEventTarget),\n\t\t\t(e) => this._getMouseColumn(e)\n\t\t));\n\n\t\tthis.lastMouseLeaveTime = -1;\n\t\tthis._height = this._context.configuration.options.get(EditorOption.layoutInfo).height;\n\n\t\tconst mouseEvents = new EditorMouseEventFactory(this.viewHelper.viewDomNode);\n\n\t\tthis._register(mouseEvents.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, true)));\n\n\t\tthis._register(mouseEvents.onMouseMove(this.viewHelper.viewDomNode, (e) => {\n\t\t\tthis._onMouseMove(e);\n\n\t\t\t// See https://github.com/microsoft/vscode/issues/138789\n\t\t\t// When moving the mouse really quickly, the browser sometimes forgets to\n\t\t\t// send us a `mouseleave` or `mouseout` event. We therefore install here\n\t\t\t// a global `mousemove` listener to manually recover if the mouse goes outside\n\t\t\t// the editor. As soon as the mouse leaves outside of the editor, we\n\t\t\t// remove this listener\n\n\t\t\tif (!this._mouseLeaveMonitor) {\n\t\t\t\tthis._mouseLeaveMonitor = dom.addDisposableListener(this.viewHelper.viewDomNode.ownerDocument, 'mousemove', (e) => {\n\t\t\t\t\tif (!this.viewHelper.viewDomNode.contains(e.target as Node | null)) {\n\t\t\t\t\t\t// went outside the editor!\n\t\t\t\t\t\tthis._onMouseLeave(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(mouseEvents.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));\n\n\t\tthis._register(mouseEvents.onMouseLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e)));\n\n\t\t// `pointerdown` events can't be used to determine if there's a double click, or triple click\n\t\t// because their `e.detail` is always 0.\n\t\t// We will therefore save the pointer id for the mouse and then reuse it in the `mousedown` event\n\t\t// for `element.setPointerCapture`.\n\t\tlet capturePointerId: number = 0;\n\t\tthis._register(mouseEvents.onPointerDown(this.viewHelper.viewDomNode, (e, pointerId) => {\n\t\t\tcapturePointerId = pointerId;\n\t\t}));\n\t\t// The `pointerup` listener registered by `GlobalEditorPointerMoveMonitor` does not get invoked 100% of the times.\n\t\t// I speculate that this is because the `pointerup` listener is only registered during the `mousedown` event, and perhaps\n\t\t// the `pointerup` event is already queued for dispatching, which makes it that the new listener doesn't get fired.\n\t\t// See https://github.com/microsoft/vscode/issues/146486 for repro steps.\n\t\t// To compensate for that, we simply register here a `pointerup` listener and just communicate it.\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.POINTER_UP, (e: PointerEvent) => {\n\t\t\tthis._mouseDownOperation.onPointerUp();\n\t\t}));\n\t\tthis._register(mouseEvents.onMouseDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e, capturePointerId)));\n\t\tthis._setupMouseWheelZoomListener();\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tprivate _setupMouseWheelZoomListener(): void {\n\n\t\tconst classifier = MouseWheelClassifier.INSTANCE;\n\n\t\tlet prevMouseWheelTime = 0;\n\t\tlet gestureStartZoomLevel = EditorZoom.getZoomLevel();\n\t\tlet gestureHasZoomModifiers = false;\n\t\tlet gestureAccumulatedDelta = 0;\n\n\t\tconst onMouseWheel = (browserEvent: IMouseWheelEvent) => {\n\t\t\tthis.viewController.emitMouseWheel(browserEvent);\n\n\t\t\tif (!this._context.configuration.options.get(EditorOption.mouseWheelZoom)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst e = new StandardWheelEvent(browserEvent);\n\t\t\tclassifier.acceptStandardWheelEvent(e);\n\n\t\t\tif (classifier.isPhysicalMouseWheel()) {\n\t\t\t\tif (hasMouseWheelZoomModifiers(browserEvent)) {\n\t\t\t\t\tconst zoomLevel: number = EditorZoom.getZoomLevel();\n\t\t\t\t\tconst delta = e.deltaY > 0 ? 1 : -1;\n\t\t\t\t\tEditorZoom.setZoomLevel(zoomLevel + delta);\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// we consider mousewheel events that occur within 50ms of each other to be part of the same gesture\n\t\t\t\t// we don't want to consider mouse wheel events where ctrl/cmd is pressed during the inertia phase\n\t\t\t\t// we also want to accumulate deltaY values from the same gesture and use that to set the zoom level\n\t\t\t\tif (Date.now() - prevMouseWheelTime > 50) {\n\t\t\t\t\t// reset if more than 50ms have passed\n\t\t\t\t\tgestureStartZoomLevel = EditorZoom.getZoomLevel();\n\t\t\t\t\tgestureHasZoomModifiers = hasMouseWheelZoomModifiers(browserEvent);\n\t\t\t\t\tgestureAccumulatedDelta = 0;\n\t\t\t\t}\n\n\t\t\t\tprevMouseWheelTime = Date.now();\n\t\t\t\tgestureAccumulatedDelta += e.deltaY;\n\n\t\t\t\tif (gestureHasZoomModifiers) {\n\t\t\t\t\tEditorZoom.setZoomLevel(gestureStartZoomLevel + gestureAccumulatedDelta / 5);\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.MOUSE_WHEEL, onMouseWheel, { capture: true, passive: false }));\n\n\t\tfunction hasMouseWheelZoomModifiers(browserEvent: IMouseWheelEvent): boolean {\n\t\t\treturn (\n\t\t\t\tplatform.isMacintosh\n\t\t\t\t\t// on macOS we support cmd + two fingers scroll (`metaKey` set)\n\t\t\t\t\t// and also the two fingers pinch gesture (`ctrKey` set)\n\t\t\t\t\t? ((browserEvent.metaKey || browserEvent.ctrlKey) && !browserEvent.shiftKey && !browserEvent.altKey)\n\t\t\t\t\t: (browserEvent.ctrlKey && !browserEvent.metaKey && !browserEvent.shiftKey && !browserEvent.altKey)\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tif (this._mouseLeaveMonitor) {\n\t\t\tthis._mouseLeaveMonitor.dispose();\n\t\t\tthis._mouseLeaveMonitor = null;\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\t// layout change\n\t\t\tconst height = this._context.configuration.options.get(EditorOption.layoutInfo).height;\n\t\t\tif (this._height !== height) {\n\t\t\t\tthis._height = height;\n\t\t\t\tthis._mouseDownOperation.onHeightChanged();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._mouseDownOperation.onCursorStateChanged(e);\n\t\treturn false;\n\t}\n\tpublic override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\treturn false;\n\t}\n\t// --- end event handlers\n\n\tpublic getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null {\n\t\tconst clientPos = new ClientCoordinates(clientX, clientY);\n\t\tconst pos = clientPos.toPageCoordinates(dom.getWindow(this.viewHelper.viewDomNode));\n\t\tconst editorPos = createEditorPagePosition(this.viewHelper.viewDomNode);\n\n\t\tif (pos.y < editorPos.y || pos.y > editorPos.y + editorPos.height || pos.x < editorPos.x || pos.x > editorPos.x + editorPos.width) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst relativePos = createCoordinatesRelativeToEditor(this.viewHelper.viewDomNode, editorPos, pos);\n\t\treturn this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), editorPos, pos, relativePos, null);\n\t}\n\n\tprotected _createMouseTarget(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget {\n\t\tlet target = e.target;\n\t\tif (!this.viewHelper.viewDomNode.contains(target)) {\n\t\t\tconst shadowRoot = dom.getShadowRoot(this.viewHelper.viewDomNode);\n\t\t\tif (shadowRoot) {\n\t\t\t\ttarget = (<any>shadowRoot).elementsFromPoint(e.posx, e.posy).find(\n\t\t\t\t\t(el: Element) => this.viewHelper.viewDomNode.contains(el)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, e.relativePos, testEventTarget ? target : null);\n\t}\n\n\tprivate _getMouseColumn(e: EditorMouseEvent): number {\n\t\treturn this.mouseTargetFactory.getMouseColumn(e.relativePos);\n\t}\n\n\tprotected _onContextMenu(e: EditorMouseEvent, testEventTarget: boolean): void {\n\t\tthis.viewController.emitContextMenu({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, testEventTarget)\n\t\t});\n\t}\n\n\tprotected _onMouseMove(e: EditorMouseEvent): void {\n\t\tconst targetIsWidget = this.mouseTargetFactory.mouseTargetIsWidget(e);\n\t\tif (!targetIsWidget) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (this._mouseDownOperation.isActive()) {\n\t\t\t// In selection/drag operation\n\t\t\treturn;\n\t\t}\n\t\tconst actualMouseMoveTime = e.timestamp;\n\t\tif (actualMouseMoveTime < this.lastMouseLeaveTime) {\n\t\t\t// Due to throttling, this event occurred before the mouse left the editor, therefore ignore it.\n\t\t\treturn;\n\t\t}\n\n\t\tthis.viewController.emitMouseMove({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, true)\n\t\t});\n\t}\n\n\tprotected _onMouseLeave(e: EditorMouseEvent): void {\n\t\tif (this._mouseLeaveMonitor) {\n\t\t\tthis._mouseLeaveMonitor.dispose();\n\t\t\tthis._mouseLeaveMonitor = null;\n\t\t}\n\t\tthis.lastMouseLeaveTime = (new Date()).getTime();\n\t\tthis.viewController.emitMouseLeave({\n\t\t\tevent: e,\n\t\t\ttarget: null\n\t\t});\n\t}\n\n\tprotected _onMouseUp(e: EditorMouseEvent): void {\n\t\tthis.viewController.emitMouseUp({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, true)\n\t\t});\n\t}\n\n\tprotected _onMouseDown(e: EditorMouseEvent, pointerId: number): void {\n\t\tconst t = this._createMouseTarget(e, true);\n\n\t\tconst targetIsContent = (t.type === MouseTargetType.CONTENT_TEXT || t.type === MouseTargetType.CONTENT_EMPTY);\n\t\tconst targetIsGutter = (t.type === MouseTargetType.GUTTER_GLYPH_MARGIN || t.type === MouseTargetType.GUTTER_LINE_NUMBERS || t.type === MouseTargetType.GUTTER_LINE_DECORATIONS);\n\t\tconst targetIsLineNumbers = (t.type === MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tconst selectOnLineNumbers = this._context.configuration.options.get(EditorOption.selectOnLineNumbers);\n\t\tconst targetIsViewZone = (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE);\n\t\tconst targetIsWidget = (t.type === MouseTargetType.CONTENT_WIDGET);\n\n\t\tlet shouldHandle = e.leftButton || e.middleButton;\n\t\tif (platform.isMacintosh && e.leftButton && e.ctrlKey) {\n\t\t\tshouldHandle = false;\n\t\t}\n\n\t\tconst focus = () => {\n\t\t\te.preventDefault();\n\t\t\tthis.viewHelper.focusTextArea();\n\t\t};\n\n\t\tif (shouldHandle && (targetIsContent || (targetIsLineNumbers && selectOnLineNumbers))) {\n\t\t\tfocus();\n\t\t\tthis._mouseDownOperation.start(t.type, e, pointerId);\n\n\t\t} else if (targetIsGutter) {\n\t\t\t// Do not steal focus\n\t\t\te.preventDefault();\n\t\t} else if (targetIsViewZone) {\n\t\t\tconst viewZoneData = t.detail;\n\t\t\tif (shouldHandle && this.viewHelper.shouldSuppressMouseDownOnViewZone(viewZoneData.viewZoneId)) {\n\t\t\t\tfocus();\n\t\t\t\tthis._mouseDownOperation.start(t.type, e, pointerId);\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t} else if (targetIsWidget && this.viewHelper.shouldSuppressMouseDownOnWidget(<string>t.detail)) {\n\t\t\tfocus();\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tthis.viewController.emitMouseDown({\n\t\t\tevent: e,\n\t\t\ttarget: t\n\t\t});\n\t}\n}\n\nclass MouseDownOperation extends Disposable {\n\n\tprivate readonly _createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget;\n\tprivate readonly _getMouseColumn: (e: EditorMouseEvent) => number;\n\n\tprivate readonly _mouseMoveMonitor: GlobalEditorPointerMoveMonitor;\n\tprivate readonly _topBottomDragScrolling: TopBottomDragScrolling;\n\tprivate readonly _leftRightDragScrolling: LeftRightDragScrolling;\n\tprivate readonly _mouseState: MouseDownState;\n\n\tprivate _currentSelection: Selection;\n\tprivate _isActive: boolean;\n\tprivate _lastMouseEvent: EditorMouseEvent | null;\n\n\tconstructor(\n\t\tprivate readonly _context: ViewContext,\n\t\tprivate readonly _viewController: ViewController,\n\t\tprivate readonly _viewHelper: IPointerHandlerHelper,\n\t\tprivate readonly _mouseTargetFactory: MouseTargetFactory,\n\t\tcreateMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget,\n\t\tgetMouseColumn: (e: EditorMouseEvent) => number\n\t) {\n\t\tsuper();\n\t\tthis._createMouseTarget = createMouseTarget;\n\t\tthis._getMouseColumn = getMouseColumn;\n\n\t\tthis._mouseMoveMonitor = this._register(new GlobalEditorPointerMoveMonitor(this._viewHelper.viewDomNode));\n\t\tthis._topBottomDragScrolling = this._register(new TopBottomDragScrolling(\n\t\t\tthis._context,\n\t\t\tthis._viewHelper,\n\t\t\tthis._mouseTargetFactory,\n\t\t\t(position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)\n\t\t));\n\t\tthis._leftRightDragScrolling = this._register(new LeftRightDragScrolling(\n\t\t\tthis._context,\n\t\t\tthis._viewHelper,\n\t\t\tthis._mouseTargetFactory,\n\t\t\t(position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)\n\t\t));\n\t\tthis._mouseState = new MouseDownState();\n\n\t\tthis._currentSelection = new Selection(1, 1, 1, 1);\n\t\tthis._isActive = false;\n\t\tthis._lastMouseEvent = null;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic isActive(): boolean {\n\t\treturn this._isActive;\n\t}\n\n\tprivate _onMouseDownThenMove(e: EditorMouseEvent): void {\n\t\tthis._lastMouseEvent = e;\n\t\tthis._mouseState.setModifiers(e);\n\n\t\tconst position = this._findMousePosition(e, false);\n\t\tif (!position) {\n\t\t\t// Ignoring because position is unknown\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._mouseState.isDragAndDrop) {\n\t\t\tthis._viewController.emitMouseDrag({\n\t\t\t\tevent: e,\n\t\t\t\ttarget: position\n\t\t\t});\n\t\t} else {\n\t\t\tif (position.type === MouseTargetType.OUTSIDE_EDITOR) {\n\t\t\t\tif (position.outsidePosition === 'above' || position.outsidePosition === 'below') {\n\t\t\t\t\tthis._topBottomDragScrolling.start(position, e);\n\t\t\t\t\tthis._leftRightDragScrolling.stop();\n\t\t\t\t} else {\n\t\t\t\t\tthis._leftRightDragScrolling.start(position, e);\n\t\t\t\t\tthis._topBottomDragScrolling.stop();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._topBottomDragScrolling.stop();\n\t\t\t\tthis._leftRightDragScrolling.stop();\n\t\t\t\tthis._dispatchMouse(position, true, NavigationCommandRevealType.Minimal);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic start(targetType: MouseTargetType, e: EditorMouseEvent, pointerId: number): void {\n\t\tthis._lastMouseEvent = e;\n\n\t\tthis._mouseState.setStartedOnLineNumbers(targetType === MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tthis._mouseState.setStartButtons(e);\n\t\tthis._mouseState.setModifiers(e);\n\t\tconst position = this._findMousePosition(e, true);\n\t\tif (!position || !position.position) {\n\t\t\t// Ignoring because position is unknown\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseState.trySetCount(e.detail, position.position);\n\n\t\t// Overwrite the detail of the MouseEvent, as it will be sent out in an event and contributions might rely on it.\n\t\te.detail = this._mouseState.count;\n\n\t\tconst options = this._context.configuration.options;\n\n\t\tif (!options.get(EditorOption.readOnly)\n\t\t\t&& options.get(EditorOption.dragAndDrop)\n\t\t\t&& !options.get(EditorOption.columnSelection)\n\t\t\t&& !this._mouseState.altKey // we don't support multiple mouse\n\t\t\t&& e.detail < 2 // only single click on a selection can work\n\t\t\t&& !this._isActive // the mouse is not down yet\n\t\t\t&& !this._currentSelection.isEmpty() // we don't drag single cursor\n\t\t\t&& (position.type === MouseTargetType.CONTENT_TEXT) // single click on text\n\t\t\t&& position.position && this._currentSelection.containsPosition(position.position) // single click on a selection\n\t\t) {\n\t\t\tthis._mouseState.isDragAndDrop = true;\n\t\t\tthis._isActive = true;\n\n\t\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\t\tthis._viewHelper.viewLinesDomNode,\n\t\t\t\tpointerId,\n\t\t\t\te.buttons,\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t(browserEvent?: MouseEvent | KeyboardEvent) => {\n\t\t\t\t\tconst position = this._findMousePosition(this._lastMouseEvent!, false);\n\n\t\t\t\t\tif (dom.isKeyboardEvent(browserEvent)) {\n\t\t\t\t\t\t// cancel\n\t\t\t\t\t\tthis._viewController.emitMouseDropCanceled();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._viewController.emitMouseDrop({\n\t\t\t\t\t\t\tevent: this._lastMouseEvent!,\n\t\t\t\t\t\t\ttarget: (position ? this._createMouseTarget(this._lastMouseEvent!, true) : null) // Ignoring because position is unknown, e.g., Content View Zone\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._stop();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseState.isDragAndDrop = false;\n\t\tthis._dispatchMouse(position, e.shiftKey, NavigationCommandRevealType.Minimal);\n\n\t\tif (!this._isActive) {\n\t\t\tthis._isActive = true;\n\t\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\t\tthis._viewHelper.viewLinesDomNode,\n\t\t\t\tpointerId,\n\t\t\t\te.buttons,\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t() => this._stop()\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate _stop(): void {\n\t\tthis._isActive = false;\n\t\tthis._topBottomDragScrolling.stop();\n\t\tthis._leftRightDragScrolling.stop();\n\t}\n\n\tpublic onHeightChanged(): void {\n\t\tthis._mouseMoveMonitor.stopMonitoring();\n\t}\n\n\tpublic onPointerUp(): void {\n\t\tthis._mouseMoveMonitor.stopMonitoring();\n\t}\n\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): void {\n\t\tthis._currentSelection = e.selections[0];\n\t}\n\n\tprivate _getPositionOutsideEditor(e: EditorMouseEvent): IMouseTarget | null {\n\t\tconst editorContent = e.editorPos;\n\t\tconst model = this._context.viewModel;\n\t\tconst viewLayout = this._context.viewLayout;\n\n\t\tconst mouseColumn = this._getMouseColumn(e);\n\n\t\tif (e.posy < editorContent.y) {\n\t\t\tconst outsideDistance = editorContent.y - e.posy;\n\t\t\tconst verticalOffset = Math.max(viewLayout.getCurrentScrollTop() - outsideDistance, 0);\n\t\t\tconst viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n\t\t\tif (viewZoneData) {\n\t\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n\t\t\t\tif (newPosition) {\n\t\t\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, newPosition, 'above', outsideDistance);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(aboveLineNumber, 1), 'above', outsideDistance);\n\t\t}\n\n\t\tif (e.posy > editorContent.y + editorContent.height) {\n\t\t\tconst outsideDistance = e.posy - editorContent.y - editorContent.height;\n\t\t\tconst verticalOffset = viewLayout.getCurrentScrollTop() + e.relativePos.y;\n\t\t\tconst viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n\t\t\tif (viewZoneData) {\n\t\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n\t\t\t\tif (newPosition) {\n\t\t\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, newPosition, 'below', outsideDistance);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber)), 'below', outsideDistance);\n\t\t}\n\n\t\tconst possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + e.relativePos.y);\n\n\t\tconst layoutInfo = this._context.configuration.options.get(EditorOption.layoutInfo);\n\n\t\tconst xLeftBoundary = layoutInfo.contentLeft;\n\t\tif (e.relativePos.x <= xLeftBoundary) {\n\t\t\tconst outsideDistance = xLeftBoundary - e.relativePos.x;\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, 1), 'left', outsideDistance);\n\t\t}\n\n\t\tconst contentRight = (\n\t\t\tlayoutInfo.minimap.minimapLeft === 0\n\t\t\t\t? layoutInfo.width - layoutInfo.verticalScrollbarWidth // Happens when minimap is hidden\n\t\t\t\t: layoutInfo.minimap.minimapLeft\n\t\t);\n\t\tconst xRightBoundary = contentRight;\n\t\tif (e.relativePos.x >= xRightBoundary) {\n\t\t\tconst outsideDistance = e.relativePos.x - xRightBoundary;\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber)), 'right', outsideDistance);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _findMousePosition(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget | null {\n\t\tconst positionOutsideEditor = this._getPositionOutsideEditor(e);\n\t\tif (positionOutsideEditor) {\n\t\t\treturn positionOutsideEditor;\n\t\t}\n\n\t\tconst t = this._createMouseTarget(e, testEventTarget);\n\t\tconst hintedPosition = t.position;\n\t\tif (!hintedPosition) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(t.detail);\n\t\t\tif (newPosition) {\n\t\t\t\treturn MouseTarget.createViewZone(t.type, t.element, t.mouseColumn, newPosition, t.detail);\n\t\t\t}\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tprivate _helpPositionJumpOverViewZone(viewZoneData: IMouseTargetViewZoneData): Position | null {\n\t\t// Force position on view zones to go above or below depending on where selection started from\n\t\tconst selectionStart = new Position(this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn);\n\t\tconst positionBefore = viewZoneData.positionBefore;\n\t\tconst positionAfter = viewZoneData.positionAfter;\n\n\t\tif (positionBefore && positionAfter) {\n\t\t\tif (positionBefore.isBefore(selectionStart)) {\n\t\t\t\treturn positionBefore;\n\t\t\t} else {\n\t\t\t\treturn positionAfter;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate _dispatchMouse(position: IMouseTarget, inSelectionMode: boolean, revealType: NavigationCommandRevealType): void {\n\t\tif (!position.position) {\n\t\t\treturn;\n\t\t}\n\t\tthis._viewController.dispatchMouse({\n\t\t\tposition: position.position,\n\t\t\tmouseColumn: position.mouseColumn,\n\t\t\tstartedOnLineNumbers: this._mouseState.startedOnLineNumbers,\n\t\t\trevealType,\n\n\t\t\tinSelectionMode: inSelectionMode,\n\t\t\tmouseDownCount: this._mouseState.count,\n\t\t\taltKey: this._mouseState.altKey,\n\t\t\tctrlKey: this._mouseState.ctrlKey,\n\t\t\tmetaKey: this._mouseState.metaKey,\n\t\t\tshiftKey: this._mouseState.shiftKey,\n\n\t\t\tleftButton: this._mouseState.leftButton,\n\t\t\tmiddleButton: this._mouseState.middleButton,\n\n\t\t\tonInjectedText: position.type === MouseTargetType.CONTENT_TEXT && position.detail.injectedText !== null\n\t\t});\n\t}\n}\n\nclass MouseDownState {\n\n\tprivate static readonly CLEAR_MOUSE_DOWN_COUNT_TIME = 400; // ms\n\n\tprivate _altKey: boolean;\n\tpublic get altKey(): boolean { return this._altKey; }\n\n\tprivate _ctrlKey: boolean;\n\tpublic get ctrlKey(): boolean { return this._ctrlKey; }\n\n\tprivate _metaKey: boolean;\n\tpublic get metaKey(): boolean { return this._metaKey; }\n\n\tprivate _shiftKey: boolean;\n\tpublic get shiftKey(): boolean { return this._shiftKey; }\n\n\tprivate _leftButton: boolean;\n\tpublic get leftButton(): boolean { return this._leftButton; }\n\n\tprivate _middleButton: boolean;\n\tpublic get middleButton(): boolean { return this._middleButton; }\n\n\tprivate _startedOnLineNumbers: boolean;\n\tpublic get startedOnLineNumbers(): boolean { return this._startedOnLineNumbers; }\n\n\tprivate _lastMouseDownPosition: Position | null;\n\tprivate _lastMouseDownPositionEqualCount: number;\n\tprivate _lastMouseDownCount: number;\n\tprivate _lastSetMouseDownCountTime: number;\n\tpublic isDragAndDrop: boolean;\n\n\tconstructor() {\n\t\tthis._altKey = false;\n\t\tthis._ctrlKey = false;\n\t\tthis._metaKey = false;\n\t\tthis._shiftKey = false;\n\t\tthis._leftButton = false;\n\t\tthis._middleButton = false;\n\t\tthis._startedOnLineNumbers = false;\n\t\tthis._lastMouseDownPosition = null;\n\t\tthis._lastMouseDownPositionEqualCount = 0;\n\t\tthis._lastMouseDownCount = 0;\n\t\tthis._lastSetMouseDownCountTime = 0;\n\t\tthis.isDragAndDrop = false;\n\t}\n\n\tpublic get count(): number {\n\t\treturn this._lastMouseDownCount;\n\t}\n\n\tpublic setModifiers(source: EditorMouseEvent) {\n\t\tthis._altKey = source.altKey;\n\t\tthis._ctrlKey = source.ctrlKey;\n\t\tthis._metaKey = source.metaKey;\n\t\tthis._shiftKey = source.shiftKey;\n\t}\n\n\tpublic setStartButtons(source: EditorMouseEvent) {\n\t\tthis._leftButton = source.leftButton;\n\t\tthis._middleButton = source.middleButton;\n\t}\n\n\tpublic setStartedOnLineNumbers(startedOnLineNumbers: boolean): void {\n\t\tthis._startedOnLineNumbers = startedOnLineNumbers;\n\t}\n\n\tpublic trySetCount(setMouseDownCount: number, newMouseDownPosition: Position): void {\n\t\t// a. Invalidate multiple clicking if too much time has passed (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n\t\tconst currentTime = (new Date()).getTime();\n\t\tif (currentTime - this._lastSetMouseDownCountTime > MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME) {\n\t\t\tsetMouseDownCount = 1;\n\t\t}\n\t\tthis._lastSetMouseDownCountTime = currentTime;\n\n\t\t// b. Ensure that we don't jump from single click to triple click in one go (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n\t\tif (setMouseDownCount > this._lastMouseDownCount + 1) {\n\t\t\tsetMouseDownCount = this._lastMouseDownCount + 1;\n\t\t}\n\n\t\t// c. Invalidate multiple clicking if the logical position is different\n\t\tif (this._lastMouseDownPosition && this._lastMouseDownPosition.equals(newMouseDownPosition)) {\n\t\t\tthis._lastMouseDownPositionEqualCount++;\n\t\t} else {\n\t\t\tthis._lastMouseDownPositionEqualCount = 1;\n\t\t}\n\t\tthis._lastMouseDownPosition = newMouseDownPosition;\n\n\t\t// Finally set the lastMouseDownCount\n\t\tthis._lastMouseDownCount = Math.min(setMouseDownCount, this._lastMouseDownPositionEqualCount);\n\t}\n\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../base/browser/dom.js';\nimport { StandardWheelEvent, IMouseWheelEvent } from '../../../base/browser/mouseEvent.js';\nimport { Disposable, IDisposable } from '../../../base/common/lifecycle.js';\nimport * as platform from '../../../base/common/platform.js';\nimport { HitTestContext, MouseTarget, MouseTargetFactory, PointerHandlerLastRenderData } from './mouseTarget.js';\nimport { IMouseTarget, IMouseTargetViewZoneData, MouseTargetType } from '../editorBrowser.js';\nimport { ClientCoordinates, EditorMouseEvent, EditorMouseEventFactory, GlobalEditorPointerMoveMonitor, createEditorPagePosition, createCoordinatesRelativeToEditor } from '../editorDom.js';\nimport { ViewController } from '../view/viewController.js';\nimport { EditorZoom } from '../../common/config/editorZoom.js';\nimport { Position } from '../../common/core/position.js';\nimport { Selection } from '../../common/core/selection.js';\nimport { HorizontalPosition } from '../view/renderingContext.js';\nimport { ViewContext } from '../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../common/viewEvents.js';\nimport { ViewEventHandler } from '../../common/viewEventHandler.js';\nimport { EditorOption } from '../../common/config/editorOptions.js';\nimport { NavigationCommandRevealType } from '../coreCommands.js';\nimport { MouseWheelClassifier } from '../../../base/browser/ui/scrollbar/scrollableElement.js';\nimport { ViewLinesGpu } from '../viewParts/viewLinesGpu/viewLinesGpu.js';\nimport { TopBottomDragScrolling, LeftRightDragScrolling } from './dragScrolling.js';\n\nexport interface IPointerHandlerHelper {\n\tviewDomNode: HTMLElement;\n\tlinesContentDomNode: HTMLElement;\n\tviewLinesDomNode: HTMLElement;\n\tviewLinesGpu: ViewLinesGpu | undefined;\n\n\tfocusTextArea(): void;\n\tdispatchTextAreaEvent(event: CustomEvent): void;\n\n\t/**\n\t * Get the last rendered information for cursors & textarea.\n\t */\n\tgetLastRenderData(): PointerHandlerLastRenderData;\n\n\t/**\n\t * Render right now\n\t */\n\trenderNow(): void;\n\n\tshouldSuppressMouseDownOnViewZone(viewZoneId: string): boolean;\n\tshouldSuppressMouseDownOnWidget(widgetId: string): boolean;\n\n\t/**\n\t * Decode a position from a rendered dom node\n\t */\n\tgetPositionFromDOMInfo(spanNode: HTMLElement, offset: number): Position | null;\n\n\tvisibleRangeForPosition(lineNumber: number, column: number): HorizontalPosition | null;\n\tgetLineWidth(lineNumber: number): number;\n}\n\nexport class MouseHandler extends ViewEventHandler {\n\n\tprotected _context: ViewContext;\n\tprotected viewController: ViewController;\n\tprotected viewHelper: IPointerHandlerHelper;\n\tprotected mouseTargetFactory: MouseTargetFactory;\n\tprotected readonly _mouseDownOperation: MouseDownOperation;\n\tprivate lastMouseLeaveTime: number;\n\tprivate _height: number;\n\tprivate _mouseLeaveMonitor: IDisposable | null = null;\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tsuper();\n\n\t\tthis._context = context;\n\t\tthis.viewController = viewController;\n\t\tthis.viewHelper = viewHelper;\n\t\tthis.mouseTargetFactory = new MouseTargetFactory(this._context, viewHelper);\n\n\t\tthis._mouseDownOperation = this._register(new MouseDownOperation(\n\t\t\tthis._context,\n\t\t\tthis.viewController,\n\t\t\tthis.viewHelper,\n\t\t\tthis.mouseTargetFactory,\n\t\t\t(e, testEventTarget) => this._createMouseTarget(e, testEventTarget),\n\t\t\t(e) => this._getMouseColumn(e)\n\t\t));\n\n\t\tthis.lastMouseLeaveTime = -1;\n\t\tthis._height = this._context.configuration.options.get(EditorOption.layoutInfo).height;\n\n\t\tconst mouseEvents = new EditorMouseEventFactory(this.viewHelper.viewDomNode);\n\n\t\tthis._register(mouseEvents.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, true)));\n\n\t\tthis._register(mouseEvents.onMouseMove(this.viewHelper.viewDomNode, (e) => {\n\t\t\tthis._onMouseMove(e);\n\n\t\t\t// See https://github.com/microsoft/vscode/issues/138789\n\t\t\t// When moving the mouse really quickly, the browser sometimes forgets to\n\t\t\t// send us a `mouseleave` or `mouseout` event. We therefore install here\n\t\t\t// a global `mousemove` listener to manually recover if the mouse goes outside\n\t\t\t// the editor. As soon as the mouse leaves outside of the editor, we\n\t\t\t// remove this listener\n\n\t\t\tif (!this._mouseLeaveMonitor) {\n\t\t\t\tthis._mouseLeaveMonitor = dom.addDisposableListener(this.viewHelper.viewDomNode.ownerDocument, 'mousemove', (e) => {\n\t\t\t\t\tif (!this.viewHelper.viewDomNode.contains(e.target as Node | null)) {\n\t\t\t\t\t\t// went outside the editor!\n\t\t\t\t\t\tthis._onMouseLeave(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(mouseEvents.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));\n\n\t\tthis._register(mouseEvents.onMouseLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e)));\n\n\t\t// `pointerdown` events can't be used to determine if there's a double click, or triple click\n\t\t// because their `e.detail` is always 0.\n\t\t// We will therefore save the pointer id for the mouse and then reuse it in the `mousedown` event\n\t\t// for `element.setPointerCapture`.\n\t\tlet capturePointerId: number = 0;\n\t\tthis._register(mouseEvents.onPointerDown(this.viewHelper.viewDomNode, (e, pointerId) => {\n\t\t\tcapturePointerId = pointerId;\n\t\t}));\n\t\t// The `pointerup` listener registered by `GlobalEditorPointerMoveMonitor` does not get invoked 100% of the times.\n\t\t// I speculate that this is because the `pointerup` listener is only registered during the `mousedown` event, and perhaps\n\t\t// the `pointerup` event is already queued for dispatching, which makes it that the new listener doesn't get fired.\n\t\t// See https://github.com/microsoft/vscode/issues/146486 for repro steps.\n\t\t// To compensate for that, we simply register here a `pointerup` listener and just communicate it.\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.POINTER_UP, (e: PointerEvent) => {\n\t\t\tthis._mouseDownOperation.onPointerUp();\n\t\t}));\n\t\tthis._register(mouseEvents.onMouseDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e, capturePointerId)));\n\t\tthis._setupMouseWheelZoomListener();\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tprivate _setupMouseWheelZoomListener(): void {\n\n\t\tconst classifier = MouseWheelClassifier.INSTANCE;\n\n\t\tlet prevMouseWheelTime = 0;\n\t\tlet gestureStartZoomLevel = EditorZoom.getZoomLevel();\n\t\tlet gestureHasZoomModifiers = false;\n\t\tlet gestureAccumulatedDelta = 0;\n\n\t\tconst onMouseWheel = (browserEvent: IMouseWheelEvent) => {\n\t\t\tthis.viewController.emitMouseWheel(browserEvent);\n\n\t\t\tif (!this._context.configuration.options.get(EditorOption.mouseWheelZoom)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst e = new StandardWheelEvent(browserEvent);\n\t\t\tclassifier.acceptStandardWheelEvent(e);\n\n\t\t\tif (classifier.isPhysicalMouseWheel()) {\n\t\t\t\tif (hasMouseWheelZoomModifiers(browserEvent)) {\n\t\t\t\t\tconst zoomLevel: number = EditorZoom.getZoomLevel();\n\t\t\t\t\tconst delta = e.deltaY > 0 ? 1 : -1;\n\t\t\t\t\tEditorZoom.setZoomLevel(zoomLevel + delta);\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// we consider mousewheel events that occur within 50ms of each other to be part of the same gesture\n\t\t\t\t// we don't want to consider mouse wheel events where ctrl/cmd is pressed during the inertia phase\n\t\t\t\t// we also want to accumulate deltaY values from the same gesture and use that to set the zoom level\n\t\t\t\tif (Date.now() - prevMouseWheelTime > 50) {\n\t\t\t\t\t// reset if more than 50ms have passed\n\t\t\t\t\tgestureStartZoomLevel = EditorZoom.getZoomLevel();\n\t\t\t\t\tgestureHasZoomModifiers = hasMouseWheelZoomModifiers(browserEvent);\n\t\t\t\t\tgestureAccumulatedDelta = 0;\n\t\t\t\t}\n\n\t\t\t\tprevMouseWheelTime = Date.now();\n\t\t\t\tgestureAccumulatedDelta += e.deltaY;\n\n\t\t\t\tif (gestureHasZoomModifiers) {\n\t\t\t\t\tEditorZoom.setZoomLevel(gestureStartZoomLevel + gestureAccumulatedDelta / 5);\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.MOUSE_WHEEL, onMouseWheel, { capture: true, passive: false }));\n\n\t\tfunction hasMouseWheelZoomModifiers(browserEvent: IMouseWheelEvent): boolean {\n\t\t\treturn (\n\t\t\t\tplatform.isMacintosh\n\t\t\t\t\t// on macOS we support cmd + two fingers scroll (`metaKey` set)\n\t\t\t\t\t// and also the two fingers pinch gesture (`ctrKey` set)\n\t\t\t\t\t? ((browserEvent.metaKey || browserEvent.ctrlKey) && !browserEvent.shiftKey && !browserEvent.altKey)\n\t\t\t\t\t: (browserEvent.ctrlKey && !browserEvent.metaKey && !browserEvent.shiftKey && !browserEvent.altKey)\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tif (this._mouseLeaveMonitor) {\n\t\t\tthis._mouseLeaveMonitor.dispose();\n\t\t\tthis._mouseLeaveMonitor = null;\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\t// layout change\n\t\t\tconst height = this._context.configuration.options.get(EditorOption.layoutInfo).height;\n\t\t\tif (this._height !== height) {\n\t\t\t\tthis._height = height;\n\t\t\t\tthis._mouseDownOperation.onHeightChanged();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._mouseDownOperation.onCursorStateChanged(e);\n\t\treturn false;\n\t}\n\tpublic override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\treturn false;\n\t}\n\t// --- end event handlers\n\n\tpublic getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null {\n\t\tconst clientPos = new ClientCoordinates(clientX, clientY);\n\t\tconst pos = clientPos.toPageCoordinates(dom.getWindow(this.viewHelper.viewDomNode));\n\t\tconst editorPos = createEditorPagePosition(this.viewHelper.viewDomNode);\n\n\t\tif (pos.y < editorPos.y || pos.y > editorPos.y + editorPos.height || pos.x < editorPos.x || pos.x > editorPos.x + editorPos.width) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst relativePos = createCoordinatesRelativeToEditor(this.viewHelper.viewDomNode, editorPos, pos);\n\t\treturn this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), editorPos, pos, relativePos, null);\n\t}\n\n\tprotected _createMouseTarget(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget {\n\t\tlet target = e.target;\n\t\tif (!this.viewHelper.viewDomNode.contains(target)) {\n\t\t\tconst shadowRoot = dom.getShadowRoot(this.viewHelper.viewDomNode);\n\t\t\tif (shadowRoot) {\n\t\t\t\ttarget = (<any>shadowRoot).elementsFromPoint(e.posx, e.posy).find(\n\t\t\t\t\t(el: Element) => this.viewHelper.viewDomNode.contains(el)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, e.relativePos, testEventTarget ? target : null);\n\t}\n\n\tprivate _getMouseColumn(e: EditorMouseEvent): number {\n\t\treturn this.mouseTargetFactory.getMouseColumn(e.relativePos);\n\t}\n\n\tprotected _onContextMenu(e: EditorMouseEvent, testEventTarget: boolean): void {\n\t\tthis.viewController.emitContextMenu({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, testEventTarget)\n\t\t});\n\t}\n\n\tprotected _onMouseMove(e: EditorMouseEvent): void {\n\t\tconst targetIsWidget = this.mouseTargetFactory.mouseTargetIsWidget(e);\n\t\tif (!targetIsWidget) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (this._mouseDownOperation.isActive()) {\n\t\t\t// In selection/drag operation\n\t\t\treturn;\n\t\t}\n\t\tconst actualMouseMoveTime = e.timestamp;\n\t\tif (actualMouseMoveTime < this.lastMouseLeaveTime) {\n\t\t\t// Due to throttling, this event occurred before the mouse left the editor, therefore ignore it.\n\t\t\treturn;\n\t\t}\n\n\t\tthis.viewController.emitMouseMove({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, true)\n\t\t});\n\t}\n\n\tprotected _onMouseLeave(e: EditorMouseEvent): void {\n\t\tif (this._mouseLeaveMonitor) {\n\t\t\tthis._mouseLeaveMonitor.dispose();\n\t\t\tthis._mouseLeaveMonitor = null;\n\t\t}\n\t\tthis.lastMouseLeaveTime = (new Date()).getTime();\n\t\tthis.viewController.emitMouseLeave({\n\t\t\tevent: e,\n\t\t\ttarget: null\n\t\t});\n\t}\n\n\tprotected _onMouseUp(e: EditorMouseEvent): void {\n\t\tthis.viewController.emitMouseUp({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, true)\n\t\t});\n\t}\n\n\tprotected _onMouseDown(e: EditorMouseEvent, pointerId: number): void {\n\t\tconst t = this._createMouseTarget(e, true);\n\n\t\tconst targetIsContent = (t.type === MouseTargetType.CONTENT_TEXT || t.type === MouseTargetType.CONTENT_EMPTY);\n\t\tconst targetIsGutter = (t.type === MouseTargetType.GUTTER_GLYPH_MARGIN || t.type === MouseTargetType.GUTTER_LINE_NUMBERS || t.type === MouseTargetType.GUTTER_LINE_DECORATIONS);\n\t\tconst targetIsLineNumbers = (t.type === MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tconst selectOnLineNumbers = this._context.configuration.options.get(EditorOption.selectOnLineNumbers);\n\t\tconst targetIsViewZone = (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE);\n\t\tconst targetIsWidget = (t.type === MouseTargetType.CONTENT_WIDGET);\n\n\t\tlet shouldHandle = e.leftButton || e.middleButton;\n\t\tif (platform.isMacintosh && e.leftButton && e.ctrlKey) {\n\t\t\tshouldHandle = false;\n\t\t}\n\n\t\tconst focus = () => {\n\t\t\te.preventDefault();\n\t\t\tthis.viewHelper.focusTextArea();\n\t\t};\n\n\t\tif (shouldHandle && (targetIsContent || (targetIsLineNumbers && selectOnLineNumbers))) {\n\t\t\tfocus();\n\t\t\tthis._mouseDownOperation.start(t.type, e, pointerId);\n\n\t\t} else if (targetIsGutter) {\n\t\t\t// Do not steal focus\n\t\t\te.preventDefault();\n\t\t} else if (targetIsViewZone) {\n\t\t\tconst viewZoneData = t.detail;\n\t\t\tif (shouldHandle && this.viewHelper.shouldSuppressMouseDownOnViewZone(viewZoneData.viewZoneId)) {\n\t\t\t\tfocus();\n\t\t\t\tthis._mouseDownOperation.start(t.type, e, pointerId);\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t} else if (targetIsWidget && this.viewHelper.shouldSuppressMouseDownOnWidget(<string>t.detail)) {\n\t\t\tfocus();\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tthis.viewController.emitMouseDown({\n\t\t\tevent: e,\n\t\t\ttarget: t\n\t\t});\n\t}\n}\n\nclass MouseDownOperation extends Disposable {\n\n\tprivate readonly _createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget;\n\tprivate readonly _getMouseColumn: (e: EditorMouseEvent) => number;\n\n\tprivate readonly _mouseMoveMonitor: GlobalEditorPointerMoveMonitor;\n\tprivate readonly _topBottomDragScrolling: TopBottomDragScrolling;\n\tprivate readonly _leftRightDragScrolling: LeftRightDragScrolling;\n\tprivate readonly _mouseState: MouseDownState;\n\n\tprivate _currentSelection: Selection;\n\tprivate _isActive: boolean;\n\tprivate _lastMouseEvent: EditorMouseEvent | null;\n\n\tconstructor(\n\t\tprivate readonly _context: ViewContext,\n\t\tprivate readonly _viewController: ViewController,\n\t\tprivate readonly _viewHelper: IPointerHandlerHelper,\n\t\tprivate readonly _mouseTargetFactory: MouseTargetFactory,\n\t\tcreateMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget,\n\t\tgetMouseColumn: (e: EditorMouseEvent) => number\n\t) {\n\t\tsuper();\n\t\tthis._createMouseTarget = createMouseTarget;\n\t\tthis._getMouseColumn = getMouseColumn;\n\n\t\tthis._mouseMoveMonitor = this._register(new GlobalEditorPointerMoveMonitor(this._viewHelper.viewDomNode));\n\t\tthis._topBottomDragScrolling = this._register(new TopBottomDragScrolling(\n\t\t\tthis._context,\n\t\t\tthis._viewHelper,\n\t\t\tthis._mouseTargetFactory,\n\t\t\t(position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)\n\t\t));\n\t\tthis._leftRightDragScrolling = this._register(new LeftRightDragScrolling(\n\t\t\tthis._context,\n\t\t\tthis._viewHelper,\n\t\t\tthis._mouseTargetFactory,\n\t\t\t(position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)\n\t\t));\n\t\tthis._mouseState = new MouseDownState();\n\n\t\tthis._currentSelection = new Selection(1, 1, 1, 1);\n\t\tthis._isActive = false;\n\t\tthis._lastMouseEvent = null;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic isActive(): boolean {\n\t\treturn this._isActive;\n\t}\n\n\tprivate _onMouseDownThenMove(e: EditorMouseEvent): void {\n\t\tthis._lastMouseEvent = e;\n\t\tthis._mouseState.setModifiers(e);\n\n\t\tconst position = this._findMousePosition(e, false);\n\t\tif (!position) {\n\t\t\t// Ignoring because position is unknown\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._mouseState.isDragAndDrop) {\n\t\t\tthis._viewController.emitMouseDrag({\n\t\t\t\tevent: e,\n\t\t\t\ttarget: position\n\t\t\t});\n\t\t} else {\n\t\t\tif (position.type === MouseTargetType.OUTSIDE_EDITOR) {\n\t\t\t\tif (position.outsidePosition === 'above' || position.outsidePosition === 'below') {\n\t\t\t\t\tthis._topBottomDragScrolling.start(position, e);\n\t\t\t\t\tthis._leftRightDragScrolling.stop();\n\t\t\t\t} else {\n\t\t\t\t\tthis._leftRightDragScrolling.start(position, e);\n\t\t\t\t\tthis._topBottomDragScrolling.stop();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._topBottomDragScrolling.stop();\n\t\t\t\tthis._leftRightDragScrolling.stop();\n\t\t\t\tthis._dispatchMouse(position, true, NavigationCommandRevealType.Minimal);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic start(targetType: MouseTargetType, e: EditorMouseEvent, pointerId: number): void {\n\t\tthis._lastMouseEvent = e;\n\n\t\tthis._mouseState.setStartedOnLineNumbers(targetType === MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tthis._mouseState.setStartButtons(e);\n\t\tthis._mouseState.setModifiers(e);\n\t\tconst position = this._findMousePosition(e, true);\n\t\tif (!position || !position.position) {\n\t\t\t// Ignoring because position is unknown\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseState.trySetCount(e.detail, position.position);\n\n\t\t// Overwrite the detail of the MouseEvent, as it will be sent out in an event and contributions might rely on it.\n\t\te.detail = this._mouseState.count;\n\n\t\tconst options = this._context.configuration.options;\n\n\t\tif (!options.get(EditorOption.readOnly)\n\t\t\t&& options.get(EditorOption.dragAndDrop)\n\t\t\t&& !options.get(EditorOption.columnSelection)\n\t\t\t&& !this._mouseState.altKey // we don't support multiple mouse\n\t\t\t&& e.detail < 2 // only single click on a selection can work\n\t\t\t&& !this._isActive // the mouse is not down yet\n\t\t\t&& !this._currentSelection.isEmpty() // we don't drag single cursor\n\t\t\t&& (position.type === MouseTargetType.CONTENT_TEXT) // single click on text\n\t\t\t&& position.position && this._currentSelection.containsPosition(position.position) // single click on a selection\n\t\t) {\n\t\t\tthis._mouseState.isDragAndDrop = true;\n\t\t\tthis._isActive = true;\n\n\t\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\t\tthis._viewHelper.viewLinesDomNode,\n\t\t\t\tpointerId,\n\t\t\t\te.buttons,\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t(browserEvent?: MouseEvent | KeyboardEvent) => {\n\t\t\t\t\tconst position = this._findMousePosition(this._lastMouseEvent!, false);\n\n\t\t\t\t\tif (dom.isKeyboardEvent(browserEvent)) {\n\t\t\t\t\t\t// cancel\n\t\t\t\t\t\tthis._viewController.emitMouseDropCanceled();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._viewController.emitMouseDrop({\n\t\t\t\t\t\t\tevent: this._lastMouseEvent!,\n\t\t\t\t\t\t\ttarget: (position ? this._createMouseTarget(this._lastMouseEvent!, true) : null) // Ignoring because position is unknown, e.g., Content View Zone\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._stop();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseState.isDragAndDrop = false;\n\t\tthis._dispatchMouse(position, e.shiftKey, NavigationCommandRevealType.Minimal);\n\n\t\tif (!this._isActive) {\n\t\t\tthis._isActive = true;\n\t\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\t\tthis._viewHelper.viewLinesDomNode,\n\t\t\t\tpointerId,\n\t\t\t\te.buttons,\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t() => this._stop()\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate _stop(): void {\n\t\tthis._isActive = false;\n\t\tthis._topBottomDragScrolling.stop();\n\t\tthis._leftRightDragScrolling.stop();\n\t}\n\n\tpublic onHeightChanged(): void {\n\t\tthis._mouseMoveMonitor.stopMonitoring();\n\t}\n\n\tpublic onPointerUp(): void {\n\t\tthis._mouseMoveMonitor.stopMonitoring();\n\t}\n\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): void {\n\t\tthis._currentSelection = e.selections[0];\n\t}\n\n\tprivate _getPositionOutsideEditor(e: EditorMouseEvent): IMouseTarget | null {\n\t\tconst editorContent = e.editorPos;\n\t\tconst model = this._context.viewModel;\n\t\tconst viewLayout = this._context.viewLayout;\n\n\t\tconst mouseColumn = this._getMouseColumn(e);\n\n\t\tif (e.posy < editorContent.y) {\n\t\t\tconst outsideDistance = editorContent.y - e.posy;\n\t\t\tconst verticalOffset = Math.max(viewLayout.getCurrentScrollTop() - outsideDistance, 0);\n\t\t\tconst viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n\t\t\tif (viewZoneData) {\n\t\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n\t\t\t\tif (newPosition) {\n\t\t\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, newPosition, 'above', outsideDistance);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(aboveLineNumber, 1), 'above', outsideDistance);\n\t\t}\n\n\t\tif (e.posy > editorContent.y + editorContent.height) {\n\t\t\tconst outsideDistance = e.posy - editorContent.y - editorContent.height;\n\t\t\tconst verticalOffset = viewLayout.getCurrentScrollTop() + e.relativePos.y;\n\t\t\tconst viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n\t\t\tif (viewZoneData) {\n\t\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n\t\t\t\tif (newPosition) {\n\t\t\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, newPosition, 'below', outsideDistance);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber)), 'below', outsideDistance);\n\t\t}\n\n\t\tconst possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + e.relativePos.y);\n\n\t\tconst layoutInfo = this._context.configuration.options.get(EditorOption.layoutInfo);\n\n\t\tconst xLeftBoundary = layoutInfo.contentLeft;\n\t\tif (e.relativePos.x <= xLeftBoundary) {\n\t\t\tconst outsideDistance = xLeftBoundary - e.relativePos.x;\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, 1), 'left', outsideDistance);\n\t\t}\n\n\t\tconst contentRight = (\n\t\t\tlayoutInfo.minimap.minimapLeft === 0\n\t\t\t\t? layoutInfo.width - layoutInfo.verticalScrollbarWidth // Happens when minimap is hidden\n\t\t\t\t: layoutInfo.minimap.minimapLeft\n\t\t);\n\t\tconst xRightBoundary = contentRight;\n\t\tif (e.relativePos.x >= xRightBoundary) {\n\t\t\tconst outsideDistance = e.relativePos.x - xRightBoundary;\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber)), 'right', outsideDistance);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _findMousePosition(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget | null {\n\t\tconst positionOutsideEditor = this._getPositionOutsideEditor(e);\n\t\tif (positionOutsideEditor) {\n\t\t\treturn positionOutsideEditor;\n\t\t}\n\n\t\tconst t = this._createMouseTarget(e, testEventTarget);\n\t\tconst hintedPosition = t.position;\n\t\tif (!hintedPosition) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(t.detail);\n\t\t\tif (newPosition) {\n\t\t\t\treturn MouseTarget.createViewZone(t.type, t.element, t.mouseColumn, newPosition, t.detail);\n\t\t\t}\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tprivate _helpPositionJumpOverViewZone(viewZoneData: IMouseTargetViewZoneData): Position | null {\n\t\t// Force position on view zones to go above or below depending on where selection started from\n\t\tconst selectionStart = new Position(this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn);\n\t\tconst positionBefore = viewZoneData.positionBefore;\n\t\tconst positionAfter = viewZoneData.positionAfter;\n\n\t\tif (positionBefore && positionAfter) {\n\t\t\tif (positionBefore.isBefore(selectionStart)) {\n\t\t\t\treturn positionBefore;\n\t\t\t} else {\n\t\t\t\treturn positionAfter;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate _dispatchMouse(position: IMouseTarget, inSelectionMode: boolean, revealType: NavigationCommandRevealType): void {\n\t\tif (!position.position) {\n\t\t\treturn;\n\t\t}\n\t\tthis._viewController.dispatchMouse({\n\t\t\tposition: position.position,\n\t\t\tmouseColumn: position.mouseColumn,\n\t\t\tstartedOnLineNumbers: this._mouseState.startedOnLineNumbers,\n\t\t\trevealType,\n\n\t\t\tinSelectionMode: inSelectionMode,\n\t\t\tmouseDownCount: this._mouseState.count,\n\t\t\taltKey: this._mouseState.altKey,\n\t\t\tctrlKey: this._mouseState.ctrlKey,\n\t\t\tmetaKey: this._mouseState.metaKey,\n\t\t\tshiftKey: this._mouseState.shiftKey,\n\n\t\t\tleftButton: this._mouseState.leftButton,\n\t\t\tmiddleButton: this._mouseState.middleButton,\n\n\t\t\tonInjectedText: position.type === MouseTargetType.CONTENT_TEXT && position.detail.injectedText !== null\n\t\t});\n\t}\n}\n\nclass MouseDownState {\n\n\tprivate static readonly CLEAR_MOUSE_DOWN_COUNT_TIME = 400; // ms\n\n\tprivate _altKey: boolean;\n\tpublic get altKey(): boolean { return this._altKey; }\n\n\tprivate _ctrlKey: boolean;\n\tpublic get ctrlKey(): boolean { return this._ctrlKey; }\n\n\tprivate _metaKey: boolean;\n\tpublic get metaKey(): boolean { return this._metaKey; }\n\n\tprivate _shiftKey: boolean;\n\tpublic get shiftKey(): boolean { return this._shiftKey; }\n\n\tprivate _leftButton: boolean;\n\tpublic get leftButton(): boolean { return this._leftButton; }\n\n\tprivate _middleButton: boolean;\n\tpublic get middleButton(): boolean { return this._middleButton; }\n\n\tprivate _startedOnLineNumbers: boolean;\n\tpublic get startedOnLineNumbers(): boolean { return this._startedOnLineNumbers; }\n\n\tprivate _lastMouseDownPosition: Position | null;\n\tprivate _lastMouseDownPositionEqualCount: number;\n\tprivate _lastMouseDownCount: number;\n\tprivate _lastSetMouseDownCountTime: number;\n\tpublic isDragAndDrop: boolean;\n\n\tconstructor() {\n\t\tthis._altKey = false;\n\t\tthis._ctrlKey = false;\n\t\tthis._metaKey = false;\n\t\tthis._shiftKey = false;\n\t\tthis._leftButton = false;\n\t\tthis._middleButton = false;\n\t\tthis._startedOnLineNumbers = false;\n\t\tthis._lastMouseDownPosition = null;\n\t\tthis._lastMouseDownPositionEqualCount = 0;\n\t\tthis._lastMouseDownCount = 0;\n\t\tthis._lastSetMouseDownCountTime = 0;\n\t\tthis.isDragAndDrop = false;\n\t}\n\n\tpublic get count(): number {\n\t\treturn this._lastMouseDownCount;\n\t}\n\n\tpublic setModifiers(source: EditorMouseEvent) {\n\t\tthis._altKey = source.altKey;\n\t\tthis._ctrlKey = source.ctrlKey;\n\t\tthis._metaKey = source.metaKey;\n\t\tthis._shiftKey = source.shiftKey;\n\t}\n\n\tpublic setStartButtons(source: EditorMouseEvent) {\n\t\tthis._leftButton = source.leftButton;\n\t\tthis._middleButton = source.middleButton;\n\t}\n\n\tpublic setStartedOnLineNumbers(startedOnLineNumbers: boolean): void {\n\t\tthis._startedOnLineNumbers = startedOnLineNumbers;\n\t}\n\n\tpublic trySetCount(setMouseDownCount: number, newMouseDownPosition: Position): void {\n\t\t// a. Invalidate multiple clicking if too much time has passed (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n\t\tconst currentTime = (new Date()).getTime();\n\t\tif (currentTime - this._lastSetMouseDownCountTime > MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME) {\n\t\t\tsetMouseDownCount = 1;\n\t\t}\n\t\tthis._lastSetMouseDownCountTime = currentTime;\n\n\t\t// b. Ensure that we don't jump from single click to triple click in one go (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n\t\tif (setMouseDownCount > this._lastMouseDownCount + 1) {\n\t\t\tsetMouseDownCount = this._lastMouseDownCount + 1;\n\t\t}\n\n\t\t// c. Invalidate multiple clicking if the logical position is different\n\t\tif (this._lastMouseDownPosition && this._lastMouseDownPosition.equals(newMouseDownPosition)) {\n\t\t\tthis._lastMouseDownPositionEqualCount++;\n\t\t} else {\n\t\t\tthis._lastMouseDownPositionEqualCount = 1;\n\t\t}\n\t\tthis._lastMouseDownPosition = newMouseDownPosition;\n\n\t\t// Finally set the lastMouseDownCount\n\t\tthis._lastMouseDownCount = Math.min(setMouseDownCount, this._lastMouseDownPositionEqualCount);\n\t}\n\n}\n"]}
1
+ {"version":3,"sources":["file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src/vs/editor/browser/controller/mouseHandler.ts","vs/editor/browser/controller/mouseHandler.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,KAAK,GAAG,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAoB,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAe,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK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;QAC3D,IAAI,CAAC,qBAAqB,GAAG,oBAAoB,CAAC;IACnD,CAAC;IAEM,WAAW,CAAC,iBAAyB,EAAE,oBAA8B;QAC3E,oJAAoJ;QACpJ,MAAM,WAAW,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QAC3C,IAAI,WAAW,GAAG,IAAI,CAAC,0BAA0B,GAAG,cAAc,CAAC,2BAA2B,EAAE,CAAC;YAChG,iBAAiB,GAAG,CAAC,CAAC;QACvB,CAAC;QACD,IAAI,CAAC,0BAA0B,GAAG,WAAW,CAAC;QAE9C,iKAAiK;QACjK,IAAI,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,GAAG,CAAC,EAAE,CAAC;YACtD,iBAAiB,GAAG,IAAI,CAAC,mBAAmB,GAAG,CAAC,CAAC;QAClD,CAAC;QAED,uEAAuE;QACvE,IAAI,IAAI,CAAC,sBAAsB,IAAI,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,CAAC;YAC7F,IAAI,CAAC,gCAAgC,EAAE,CAAC;QACzC,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,gCAAgC,GAAG,CAAC,CAAC;QAC3C,CAAC;QACD,IAAI,CAAC,sBAAsB,GAAG,oBAAoB,CAAC;QAEnD,qCAAqC;QACrC,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAC/F,CAAC","file":"mouseHandler.js","sourceRoot":"file:///mnt/vss/_work/1/s/dependencies/vscode/out-editor-src","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../base/browser/dom.js';\nimport { StandardWheelEvent, IMouseWheelEvent } from '../../../base/browser/mouseEvent.js';\nimport { Disposable, IDisposable } from '../../../base/common/lifecycle.js';\nimport * as platform from '../../../base/common/platform.js';\nimport { HitTestContext, MouseTarget, MouseTargetFactory, PointerHandlerLastRenderData } from './mouseTarget.js';\nimport { IMouseTarget, IMouseTargetViewZoneData, MouseTargetType } from '../editorBrowser.js';\nimport { ClientCoordinates, EditorMouseEvent, EditorMouseEventFactory, GlobalEditorPointerMoveMonitor, createEditorPagePosition, createCoordinatesRelativeToEditor } from '../editorDom.js';\nimport { ViewController } from '../view/viewController.js';\nimport { EditorZoom } from '../../common/config/editorZoom.js';\nimport { Position } from '../../common/core/position.js';\nimport { Selection } from '../../common/core/selection.js';\nimport { HorizontalPosition } from '../view/renderingContext.js';\nimport { ViewContext } from '../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../common/viewEvents.js';\nimport { ViewEventHandler } from '../../common/viewEventHandler.js';\nimport { EditorOption } from '../../common/config/editorOptions.js';\nimport { NavigationCommandRevealType } from '../coreCommands.js';\nimport { MouseWheelClassifier } from '../../../base/browser/ui/scrollbar/scrollableElement.js';\nimport { ViewLinesGpu } from '../viewParts/viewLinesGpu/viewLinesGpu.js';\nimport { TopBottomDragScrolling, LeftRightDragScrolling } from './dragScrolling.js';\n\nexport interface IPointerHandlerHelper {\n\tviewDomNode: HTMLElement;\n\tlinesContentDomNode: HTMLElement;\n\tviewLinesDomNode: HTMLElement;\n\tviewLinesGpu: ViewLinesGpu | undefined;\n\n\tfocusTextArea(): void;\n\tdispatchTextAreaEvent(event: CustomEvent): void;\n\n\t/**\n\t * Get the last rendered information for cursors & textarea.\n\t */\n\tgetLastRenderData(): PointerHandlerLastRenderData;\n\n\t/**\n\t * Render right now\n\t */\n\trenderNow(): void;\n\n\tshouldSuppressMouseDownOnViewZone(viewZoneId: string): boolean;\n\tshouldSuppressMouseDownOnWidget(widgetId: string): boolean;\n\n\t/**\n\t * Decode a position from a rendered dom node\n\t */\n\tgetPositionFromDOMInfo(spanNode: HTMLElement, offset: number): Position | null;\n\n\tvisibleRangeForPosition(lineNumber: number, column: number): HorizontalPosition | null;\n\tgetLineWidth(lineNumber: number): number;\n}\n\nexport class MouseHandler extends ViewEventHandler {\n\n\tprotected _context: ViewContext;\n\tprotected viewController: ViewController;\n\tprotected viewHelper: IPointerHandlerHelper;\n\tprotected mouseTargetFactory: MouseTargetFactory;\n\tprotected readonly _mouseDownOperation: MouseDownOperation;\n\tprivate lastMouseLeaveTime: number;\n\tprivate _height: number;\n\tprivate _mouseLeaveMonitor: IDisposable | null = null;\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tsuper();\n\n\t\tthis._context = context;\n\t\tthis.viewController = viewController;\n\t\tthis.viewHelper = viewHelper;\n\t\tthis.mouseTargetFactory = new MouseTargetFactory(this._context, viewHelper);\n\n\t\tthis._mouseDownOperation = this._register(new MouseDownOperation(\n\t\t\tthis._context,\n\t\t\tthis.viewController,\n\t\t\tthis.viewHelper,\n\t\t\tthis.mouseTargetFactory,\n\t\t\t(e, testEventTarget) => this._createMouseTarget(e, testEventTarget),\n\t\t\t(e) => this._getMouseColumn(e)\n\t\t));\n\n\t\tthis.lastMouseLeaveTime = -1;\n\t\tthis._height = this._context.configuration.options.get(EditorOption.layoutInfo).height;\n\n\t\tconst mouseEvents = new EditorMouseEventFactory(this.viewHelper.viewDomNode);\n\n\t\tthis._register(mouseEvents.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, true)));\n\n\t\tthis._register(mouseEvents.onMouseMove(this.viewHelper.viewDomNode, (e) => {\n\t\t\tthis._onMouseMove(e);\n\n\t\t\t// See https://github.com/microsoft/vscode/issues/138789\n\t\t\t// When moving the mouse really quickly, the browser sometimes forgets to\n\t\t\t// send us a `mouseleave` or `mouseout` event. We therefore install here\n\t\t\t// a global `mousemove` listener to manually recover if the mouse goes outside\n\t\t\t// the editor. As soon as the mouse leaves outside of the editor, we\n\t\t\t// remove this listener\n\n\t\t\tif (!this._mouseLeaveMonitor) {\n\t\t\t\tthis._mouseLeaveMonitor = dom.addDisposableListener(this.viewHelper.viewDomNode.ownerDocument, 'mousemove', (e) => {\n\t\t\t\t\tif (!this.viewHelper.viewDomNode.contains(e.target as Node | null)) {\n\t\t\t\t\t\t// went outside the editor!\n\t\t\t\t\t\tthis._onMouseLeave(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(mouseEvents.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));\n\n\t\tthis._register(mouseEvents.onMouseLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e)));\n\n\t\t// `pointerdown` events can't be used to determine if there's a double click, or triple click\n\t\t// because their `e.detail` is always 0.\n\t\t// We will therefore save the pointer id for the mouse and then reuse it in the `mousedown` event\n\t\t// for `element.setPointerCapture`.\n\t\tlet capturePointerId: number = 0;\n\t\tthis._register(mouseEvents.onPointerDown(this.viewHelper.viewDomNode, (e, pointerId) => {\n\t\t\tcapturePointerId = pointerId;\n\t\t}));\n\t\t// The `pointerup` listener registered by `GlobalEditorPointerMoveMonitor` does not get invoked 100% of the times.\n\t\t// I speculate that this is because the `pointerup` listener is only registered during the `mousedown` event, and perhaps\n\t\t// the `pointerup` event is already queued for dispatching, which makes it that the new listener doesn't get fired.\n\t\t// See https://github.com/microsoft/vscode/issues/146486 for repro steps.\n\t\t// To compensate for that, we simply register here a `pointerup` listener and just communicate it.\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.POINTER_UP, (e: PointerEvent) => {\n\t\t\tthis._mouseDownOperation.onPointerUp();\n\t\t}));\n\t\tthis._register(mouseEvents.onMouseDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e, capturePointerId)));\n\t\tthis._setupMouseWheelZoomListener();\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tprivate _setupMouseWheelZoomListener(): void {\n\n\t\tconst classifier = MouseWheelClassifier.INSTANCE;\n\n\t\tlet prevMouseWheelTime = 0;\n\t\tlet gestureStartZoomLevel = EditorZoom.getZoomLevel();\n\t\tlet gestureHasZoomModifiers = false;\n\t\tlet gestureAccumulatedDelta = 0;\n\n\t\tconst onMouseWheel = (browserEvent: IMouseWheelEvent) => {\n\t\t\tthis.viewController.emitMouseWheel(browserEvent);\n\n\t\t\tif (!this._context.configuration.options.get(EditorOption.mouseWheelZoom)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst e = new StandardWheelEvent(browserEvent);\n\t\t\tclassifier.acceptStandardWheelEvent(e);\n\n\t\t\tif (classifier.isPhysicalMouseWheel()) {\n\t\t\t\tif (hasMouseWheelZoomModifiers(browserEvent)) {\n\t\t\t\t\tconst zoomLevel: number = EditorZoom.getZoomLevel();\n\t\t\t\t\tconst delta = e.deltaY > 0 ? 1 : -1;\n\t\t\t\t\tEditorZoom.setZoomLevel(zoomLevel + delta);\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// we consider mousewheel events that occur within 50ms of each other to be part of the same gesture\n\t\t\t\t// we don't want to consider mouse wheel events where ctrl/cmd is pressed during the inertia phase\n\t\t\t\t// we also want to accumulate deltaY values from the same gesture and use that to set the zoom level\n\t\t\t\tif (Date.now() - prevMouseWheelTime > 50) {\n\t\t\t\t\t// reset if more than 50ms have passed\n\t\t\t\t\tgestureStartZoomLevel = EditorZoom.getZoomLevel();\n\t\t\t\t\tgestureHasZoomModifiers = hasMouseWheelZoomModifiers(browserEvent);\n\t\t\t\t\tgestureAccumulatedDelta = 0;\n\t\t\t\t}\n\n\t\t\t\tprevMouseWheelTime = Date.now();\n\t\t\t\tgestureAccumulatedDelta += e.deltaY;\n\n\t\t\t\tif (gestureHasZoomModifiers) {\n\t\t\t\t\tEditorZoom.setZoomLevel(gestureStartZoomLevel + gestureAccumulatedDelta / 5);\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.MOUSE_WHEEL, onMouseWheel, { capture: true, passive: false }));\n\n\t\tfunction hasMouseWheelZoomModifiers(browserEvent: IMouseWheelEvent): boolean {\n\t\t\treturn (\n\t\t\t\tplatform.isMacintosh\n\t\t\t\t\t// on macOS we support cmd + two fingers scroll (`metaKey` set)\n\t\t\t\t\t// and also the two fingers pinch gesture (`ctrKey` set)\n\t\t\t\t\t? ((browserEvent.metaKey || browserEvent.ctrlKey) && !browserEvent.shiftKey && !browserEvent.altKey)\n\t\t\t\t\t: (browserEvent.ctrlKey && !browserEvent.metaKey && !browserEvent.shiftKey && !browserEvent.altKey)\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tif (this._mouseLeaveMonitor) {\n\t\t\tthis._mouseLeaveMonitor.dispose();\n\t\t\tthis._mouseLeaveMonitor = null;\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\t// layout change\n\t\t\tconst height = this._context.configuration.options.get(EditorOption.layoutInfo).height;\n\t\t\tif (this._height !== height) {\n\t\t\t\tthis._height = height;\n\t\t\t\tthis._mouseDownOperation.onHeightChanged();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._mouseDownOperation.onCursorStateChanged(e);\n\t\treturn false;\n\t}\n\tpublic override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\treturn false;\n\t}\n\t// --- end event handlers\n\n\tpublic getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null {\n\t\tconst clientPos = new ClientCoordinates(clientX, clientY);\n\t\tconst pos = clientPos.toPageCoordinates(dom.getWindow(this.viewHelper.viewDomNode));\n\t\tconst editorPos = createEditorPagePosition(this.viewHelper.viewDomNode);\n\n\t\tif (pos.y < editorPos.y || pos.y > editorPos.y + editorPos.height || pos.x < editorPos.x || pos.x > editorPos.x + editorPos.width) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst relativePos = createCoordinatesRelativeToEditor(this.viewHelper.viewDomNode, editorPos, pos);\n\t\treturn this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), editorPos, pos, relativePos, null);\n\t}\n\n\tprotected _createMouseTarget(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget {\n\t\tlet target: HTMLElement | null = e.target;\n\t\tif (!this.viewHelper.viewDomNode.contains(target)) {\n\t\t\tconst shadowRoot = dom.getShadowRoot(this.viewHelper.viewDomNode);\n\t\t\tif (shadowRoot) {\n\t\t\t\tconst potentialTarget = shadowRoot.elementsFromPoint(e.posx, e.posy).find(\n\t\t\t\t\t(el: Element) => this.viewHelper.viewDomNode.contains(el)\n\t\t\t\t) ?? null;\n\t\t\t\ttarget = potentialTarget as HTMLElement;\n\t\t\t}\n\t\t}\n\t\treturn this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, e.relativePos, testEventTarget ? target : null);\n\t}\n\n\tprivate _getMouseColumn(e: EditorMouseEvent): number {\n\t\treturn this.mouseTargetFactory.getMouseColumn(e.relativePos);\n\t}\n\n\tprotected _onContextMenu(e: EditorMouseEvent, testEventTarget: boolean): void {\n\t\tthis.viewController.emitContextMenu({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, testEventTarget)\n\t\t});\n\t}\n\n\tprotected _onMouseMove(e: EditorMouseEvent): void {\n\t\tconst targetIsWidget = this.mouseTargetFactory.mouseTargetIsWidget(e);\n\t\tif (!targetIsWidget) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (this._mouseDownOperation.isActive()) {\n\t\t\t// In selection/drag operation\n\t\t\treturn;\n\t\t}\n\t\tconst actualMouseMoveTime = e.timestamp;\n\t\tif (actualMouseMoveTime < this.lastMouseLeaveTime) {\n\t\t\t// Due to throttling, this event occurred before the mouse left the editor, therefore ignore it.\n\t\t\treturn;\n\t\t}\n\n\t\tthis.viewController.emitMouseMove({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, true)\n\t\t});\n\t}\n\n\tprotected _onMouseLeave(e: EditorMouseEvent): void {\n\t\tif (this._mouseLeaveMonitor) {\n\t\t\tthis._mouseLeaveMonitor.dispose();\n\t\t\tthis._mouseLeaveMonitor = null;\n\t\t}\n\t\tthis.lastMouseLeaveTime = (new Date()).getTime();\n\t\tthis.viewController.emitMouseLeave({\n\t\t\tevent: e,\n\t\t\ttarget: null\n\t\t});\n\t}\n\n\tprotected _onMouseUp(e: EditorMouseEvent): void {\n\t\tthis.viewController.emitMouseUp({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, true)\n\t\t});\n\t}\n\n\tprotected _onMouseDown(e: EditorMouseEvent, pointerId: number): void {\n\t\tconst t = this._createMouseTarget(e, true);\n\n\t\tconst targetIsContent = (t.type === MouseTargetType.CONTENT_TEXT || t.type === MouseTargetType.CONTENT_EMPTY);\n\t\tconst targetIsGutter = (t.type === MouseTargetType.GUTTER_GLYPH_MARGIN || t.type === MouseTargetType.GUTTER_LINE_NUMBERS || t.type === MouseTargetType.GUTTER_LINE_DECORATIONS);\n\t\tconst targetIsLineNumbers = (t.type === MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tconst selectOnLineNumbers = this._context.configuration.options.get(EditorOption.selectOnLineNumbers);\n\t\tconst targetIsViewZone = (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE);\n\t\tconst targetIsWidget = (t.type === MouseTargetType.CONTENT_WIDGET);\n\n\t\tlet shouldHandle = e.leftButton || e.middleButton;\n\t\tif (platform.isMacintosh && e.leftButton && e.ctrlKey) {\n\t\t\tshouldHandle = false;\n\t\t}\n\n\t\tconst focus = () => {\n\t\t\te.preventDefault();\n\t\t\tthis.viewHelper.focusTextArea();\n\t\t};\n\n\t\tif (shouldHandle && (targetIsContent || (targetIsLineNumbers && selectOnLineNumbers))) {\n\t\t\tfocus();\n\t\t\tthis._mouseDownOperation.start(t.type, e, pointerId);\n\n\t\t} else if (targetIsGutter) {\n\t\t\t// Do not steal focus\n\t\t\te.preventDefault();\n\t\t} else if (targetIsViewZone) {\n\t\t\tconst viewZoneData = t.detail;\n\t\t\tif (shouldHandle && this.viewHelper.shouldSuppressMouseDownOnViewZone(viewZoneData.viewZoneId)) {\n\t\t\t\tfocus();\n\t\t\t\tthis._mouseDownOperation.start(t.type, e, pointerId);\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t} else if (targetIsWidget && this.viewHelper.shouldSuppressMouseDownOnWidget(<string>t.detail)) {\n\t\t\tfocus();\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tthis.viewController.emitMouseDown({\n\t\t\tevent: e,\n\t\t\ttarget: t\n\t\t});\n\t}\n}\n\nclass MouseDownOperation extends Disposable {\n\n\tprivate readonly _createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget;\n\tprivate readonly _getMouseColumn: (e: EditorMouseEvent) => number;\n\n\tprivate readonly _mouseMoveMonitor: GlobalEditorPointerMoveMonitor;\n\tprivate readonly _topBottomDragScrolling: TopBottomDragScrolling;\n\tprivate readonly _leftRightDragScrolling: LeftRightDragScrolling;\n\tprivate readonly _mouseState: MouseDownState;\n\n\tprivate _currentSelection: Selection;\n\tprivate _isActive: boolean;\n\tprivate _lastMouseEvent: EditorMouseEvent | null;\n\n\tconstructor(\n\t\tprivate readonly _context: ViewContext,\n\t\tprivate readonly _viewController: ViewController,\n\t\tprivate readonly _viewHelper: IPointerHandlerHelper,\n\t\tprivate readonly _mouseTargetFactory: MouseTargetFactory,\n\t\tcreateMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget,\n\t\tgetMouseColumn: (e: EditorMouseEvent) => number\n\t) {\n\t\tsuper();\n\t\tthis._createMouseTarget = createMouseTarget;\n\t\tthis._getMouseColumn = getMouseColumn;\n\n\t\tthis._mouseMoveMonitor = this._register(new GlobalEditorPointerMoveMonitor(this._viewHelper.viewDomNode));\n\t\tthis._topBottomDragScrolling = this._register(new TopBottomDragScrolling(\n\t\t\tthis._context,\n\t\t\tthis._viewHelper,\n\t\t\tthis._mouseTargetFactory,\n\t\t\t(position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)\n\t\t));\n\t\tthis._leftRightDragScrolling = this._register(new LeftRightDragScrolling(\n\t\t\tthis._context,\n\t\t\tthis._viewHelper,\n\t\t\tthis._mouseTargetFactory,\n\t\t\t(position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)\n\t\t));\n\t\tthis._mouseState = new MouseDownState();\n\n\t\tthis._currentSelection = new Selection(1, 1, 1, 1);\n\t\tthis._isActive = false;\n\t\tthis._lastMouseEvent = null;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic isActive(): boolean {\n\t\treturn this._isActive;\n\t}\n\n\tprivate _onMouseDownThenMove(e: EditorMouseEvent): void {\n\t\tthis._lastMouseEvent = e;\n\t\tthis._mouseState.setModifiers(e);\n\n\t\tconst position = this._findMousePosition(e, false);\n\t\tif (!position) {\n\t\t\t// Ignoring because position is unknown\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._mouseState.isDragAndDrop) {\n\t\t\tthis._viewController.emitMouseDrag({\n\t\t\t\tevent: e,\n\t\t\t\ttarget: position\n\t\t\t});\n\t\t} else {\n\t\t\tif (position.type === MouseTargetType.OUTSIDE_EDITOR) {\n\t\t\t\tif (position.outsidePosition === 'above' || position.outsidePosition === 'below') {\n\t\t\t\t\tthis._topBottomDragScrolling.start(position, e);\n\t\t\t\t\tthis._leftRightDragScrolling.stop();\n\t\t\t\t} else {\n\t\t\t\t\tthis._leftRightDragScrolling.start(position, e);\n\t\t\t\t\tthis._topBottomDragScrolling.stop();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._topBottomDragScrolling.stop();\n\t\t\t\tthis._leftRightDragScrolling.stop();\n\t\t\t\tthis._dispatchMouse(position, true, NavigationCommandRevealType.Minimal);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic start(targetType: MouseTargetType, e: EditorMouseEvent, pointerId: number): void {\n\t\tthis._lastMouseEvent = e;\n\n\t\tthis._mouseState.setStartedOnLineNumbers(targetType === MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tthis._mouseState.setStartButtons(e);\n\t\tthis._mouseState.setModifiers(e);\n\t\tconst position = this._findMousePosition(e, true);\n\t\tif (!position || !position.position) {\n\t\t\t// Ignoring because position is unknown\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseState.trySetCount(e.detail, position.position);\n\n\t\t// Overwrite the detail of the MouseEvent, as it will be sent out in an event and contributions might rely on it.\n\t\te.detail = this._mouseState.count;\n\n\t\tconst options = this._context.configuration.options;\n\n\t\tif (!options.get(EditorOption.readOnly)\n\t\t\t&& options.get(EditorOption.dragAndDrop)\n\t\t\t&& !options.get(EditorOption.columnSelection)\n\t\t\t&& !this._mouseState.altKey // we don't support multiple mouse\n\t\t\t&& e.detail < 2 // only single click on a selection can work\n\t\t\t&& !this._isActive // the mouse is not down yet\n\t\t\t&& !this._currentSelection.isEmpty() // we don't drag single cursor\n\t\t\t&& (position.type === MouseTargetType.CONTENT_TEXT) // single click on text\n\t\t\t&& position.position && this._currentSelection.containsPosition(position.position) // single click on a selection\n\t\t) {\n\t\t\tthis._mouseState.isDragAndDrop = true;\n\t\t\tthis._isActive = true;\n\n\t\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\t\tthis._viewHelper.viewLinesDomNode,\n\t\t\t\tpointerId,\n\t\t\t\te.buttons,\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t(browserEvent?: MouseEvent | KeyboardEvent) => {\n\t\t\t\t\tconst position = this._findMousePosition(this._lastMouseEvent!, false);\n\n\t\t\t\t\tif (dom.isKeyboardEvent(browserEvent)) {\n\t\t\t\t\t\t// cancel\n\t\t\t\t\t\tthis._viewController.emitMouseDropCanceled();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._viewController.emitMouseDrop({\n\t\t\t\t\t\t\tevent: this._lastMouseEvent!,\n\t\t\t\t\t\t\ttarget: (position ? this._createMouseTarget(this._lastMouseEvent!, true) : null) // Ignoring because position is unknown, e.g., Content View Zone\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._stop();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseState.isDragAndDrop = false;\n\t\tthis._dispatchMouse(position, e.shiftKey, NavigationCommandRevealType.Minimal);\n\n\t\tif (!this._isActive) {\n\t\t\tthis._isActive = true;\n\t\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\t\tthis._viewHelper.viewLinesDomNode,\n\t\t\t\tpointerId,\n\t\t\t\te.buttons,\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t() => this._stop()\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate _stop(): void {\n\t\tthis._isActive = false;\n\t\tthis._topBottomDragScrolling.stop();\n\t\tthis._leftRightDragScrolling.stop();\n\t}\n\n\tpublic onHeightChanged(): void {\n\t\tthis._mouseMoveMonitor.stopMonitoring();\n\t}\n\n\tpublic onPointerUp(): void {\n\t\tthis._mouseMoveMonitor.stopMonitoring();\n\t}\n\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): void {\n\t\tthis._currentSelection = e.selections[0];\n\t}\n\n\tprivate _getPositionOutsideEditor(e: EditorMouseEvent): IMouseTarget | null {\n\t\tconst editorContent = e.editorPos;\n\t\tconst model = this._context.viewModel;\n\t\tconst viewLayout = this._context.viewLayout;\n\n\t\tconst mouseColumn = this._getMouseColumn(e);\n\n\t\tif (e.posy < editorContent.y) {\n\t\t\tconst outsideDistance = editorContent.y - e.posy;\n\t\t\tconst verticalOffset = Math.max(viewLayout.getCurrentScrollTop() - outsideDistance, 0);\n\t\t\tconst viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n\t\t\tif (viewZoneData) {\n\t\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n\t\t\t\tif (newPosition) {\n\t\t\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, newPosition, 'above', outsideDistance);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(aboveLineNumber, 1), 'above', outsideDistance);\n\t\t}\n\n\t\tif (e.posy > editorContent.y + editorContent.height) {\n\t\t\tconst outsideDistance = e.posy - editorContent.y - editorContent.height;\n\t\t\tconst verticalOffset = viewLayout.getCurrentScrollTop() + e.relativePos.y;\n\t\t\tconst viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n\t\t\tif (viewZoneData) {\n\t\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n\t\t\t\tif (newPosition) {\n\t\t\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, newPosition, 'below', outsideDistance);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber)), 'below', outsideDistance);\n\t\t}\n\n\t\tconst possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + e.relativePos.y);\n\n\t\tconst layoutInfo = this._context.configuration.options.get(EditorOption.layoutInfo);\n\n\t\tconst xLeftBoundary = layoutInfo.contentLeft;\n\t\tif (e.relativePos.x <= xLeftBoundary) {\n\t\t\tconst outsideDistance = xLeftBoundary - e.relativePos.x;\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, 1), 'left', outsideDistance);\n\t\t}\n\n\t\tconst contentRight = (\n\t\t\tlayoutInfo.minimap.minimapLeft === 0\n\t\t\t\t? layoutInfo.width - layoutInfo.verticalScrollbarWidth // Happens when minimap is hidden\n\t\t\t\t: layoutInfo.minimap.minimapLeft\n\t\t);\n\t\tconst xRightBoundary = contentRight;\n\t\tif (e.relativePos.x >= xRightBoundary) {\n\t\t\tconst outsideDistance = e.relativePos.x - xRightBoundary;\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber)), 'right', outsideDistance);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _findMousePosition(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget | null {\n\t\tconst positionOutsideEditor = this._getPositionOutsideEditor(e);\n\t\tif (positionOutsideEditor) {\n\t\t\treturn positionOutsideEditor;\n\t\t}\n\n\t\tconst t = this._createMouseTarget(e, testEventTarget);\n\t\tconst hintedPosition = t.position;\n\t\tif (!hintedPosition) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(t.detail);\n\t\t\tif (newPosition) {\n\t\t\t\treturn MouseTarget.createViewZone(t.type, t.element, t.mouseColumn, newPosition, t.detail);\n\t\t\t}\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tprivate _helpPositionJumpOverViewZone(viewZoneData: IMouseTargetViewZoneData): Position | null {\n\t\t// Force position on view zones to go above or below depending on where selection started from\n\t\tconst selectionStart = new Position(this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn);\n\t\tconst positionBefore = viewZoneData.positionBefore;\n\t\tconst positionAfter = viewZoneData.positionAfter;\n\n\t\tif (positionBefore && positionAfter) {\n\t\t\tif (positionBefore.isBefore(selectionStart)) {\n\t\t\t\treturn positionBefore;\n\t\t\t} else {\n\t\t\t\treturn positionAfter;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate _dispatchMouse(position: IMouseTarget, inSelectionMode: boolean, revealType: NavigationCommandRevealType): void {\n\t\tif (!position.position) {\n\t\t\treturn;\n\t\t}\n\t\tthis._viewController.dispatchMouse({\n\t\t\tposition: position.position,\n\t\t\tmouseColumn: position.mouseColumn,\n\t\t\tstartedOnLineNumbers: this._mouseState.startedOnLineNumbers,\n\t\t\trevealType,\n\n\t\t\tinSelectionMode: inSelectionMode,\n\t\t\tmouseDownCount: this._mouseState.count,\n\t\t\taltKey: this._mouseState.altKey,\n\t\t\tctrlKey: this._mouseState.ctrlKey,\n\t\t\tmetaKey: this._mouseState.metaKey,\n\t\t\tshiftKey: this._mouseState.shiftKey,\n\n\t\t\tleftButton: this._mouseState.leftButton,\n\t\t\tmiddleButton: this._mouseState.middleButton,\n\n\t\t\tonInjectedText: position.type === MouseTargetType.CONTENT_TEXT && position.detail.injectedText !== null\n\t\t});\n\t}\n}\n\nclass MouseDownState {\n\n\tprivate static readonly CLEAR_MOUSE_DOWN_COUNT_TIME = 400; // ms\n\n\tprivate _altKey: boolean;\n\tpublic get altKey(): boolean { return this._altKey; }\n\n\tprivate _ctrlKey: boolean;\n\tpublic get ctrlKey(): boolean { return this._ctrlKey; }\n\n\tprivate _metaKey: boolean;\n\tpublic get metaKey(): boolean { return this._metaKey; }\n\n\tprivate _shiftKey: boolean;\n\tpublic get shiftKey(): boolean { return this._shiftKey; }\n\n\tprivate _leftButton: boolean;\n\tpublic get leftButton(): boolean { return this._leftButton; }\n\n\tprivate _middleButton: boolean;\n\tpublic get middleButton(): boolean { return this._middleButton; }\n\n\tprivate _startedOnLineNumbers: boolean;\n\tpublic get startedOnLineNumbers(): boolean { return this._startedOnLineNumbers; }\n\n\tprivate _lastMouseDownPosition: Position | null;\n\tprivate _lastMouseDownPositionEqualCount: number;\n\tprivate _lastMouseDownCount: number;\n\tprivate _lastSetMouseDownCountTime: number;\n\tpublic isDragAndDrop: boolean;\n\n\tconstructor() {\n\t\tthis._altKey = false;\n\t\tthis._ctrlKey = false;\n\t\tthis._metaKey = false;\n\t\tthis._shiftKey = false;\n\t\tthis._leftButton = false;\n\t\tthis._middleButton = false;\n\t\tthis._startedOnLineNumbers = false;\n\t\tthis._lastMouseDownPosition = null;\n\t\tthis._lastMouseDownPositionEqualCount = 0;\n\t\tthis._lastMouseDownCount = 0;\n\t\tthis._lastSetMouseDownCountTime = 0;\n\t\tthis.isDragAndDrop = false;\n\t}\n\n\tpublic get count(): number {\n\t\treturn this._lastMouseDownCount;\n\t}\n\n\tpublic setModifiers(source: EditorMouseEvent) {\n\t\tthis._altKey = source.altKey;\n\t\tthis._ctrlKey = source.ctrlKey;\n\t\tthis._metaKey = source.metaKey;\n\t\tthis._shiftKey = source.shiftKey;\n\t}\n\n\tpublic setStartButtons(source: EditorMouseEvent) {\n\t\tthis._leftButton = source.leftButton;\n\t\tthis._middleButton = source.middleButton;\n\t}\n\n\tpublic setStartedOnLineNumbers(startedOnLineNumbers: boolean): void {\n\t\tthis._startedOnLineNumbers = startedOnLineNumbers;\n\t}\n\n\tpublic trySetCount(setMouseDownCount: number, newMouseDownPosition: Position): void {\n\t\t// a. Invalidate multiple clicking if too much time has passed (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n\t\tconst currentTime = (new Date()).getTime();\n\t\tif (currentTime - this._lastSetMouseDownCountTime > MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME) {\n\t\t\tsetMouseDownCount = 1;\n\t\t}\n\t\tthis._lastSetMouseDownCountTime = currentTime;\n\n\t\t// b. Ensure that we don't jump from single click to triple click in one go (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n\t\tif (setMouseDownCount > this._lastMouseDownCount + 1) {\n\t\t\tsetMouseDownCount = this._lastMouseDownCount + 1;\n\t\t}\n\n\t\t// c. Invalidate multiple clicking if the logical position is different\n\t\tif (this._lastMouseDownPosition && this._lastMouseDownPosition.equals(newMouseDownPosition)) {\n\t\t\tthis._lastMouseDownPositionEqualCount++;\n\t\t} else {\n\t\t\tthis._lastMouseDownPositionEqualCount = 1;\n\t\t}\n\t\tthis._lastMouseDownPosition = newMouseDownPosition;\n\n\t\t// Finally set the lastMouseDownCount\n\t\tthis._lastMouseDownCount = Math.min(setMouseDownCount, this._lastMouseDownPositionEqualCount);\n\t}\n\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\nimport * as dom from '../../../base/browser/dom.js';\nimport { StandardWheelEvent, IMouseWheelEvent } from '../../../base/browser/mouseEvent.js';\nimport { Disposable, IDisposable } from '../../../base/common/lifecycle.js';\nimport * as platform from '../../../base/common/platform.js';\nimport { HitTestContext, MouseTarget, MouseTargetFactory, PointerHandlerLastRenderData } from './mouseTarget.js';\nimport { IMouseTarget, IMouseTargetViewZoneData, MouseTargetType } from '../editorBrowser.js';\nimport { ClientCoordinates, EditorMouseEvent, EditorMouseEventFactory, GlobalEditorPointerMoveMonitor, createEditorPagePosition, createCoordinatesRelativeToEditor } from '../editorDom.js';\nimport { ViewController } from '../view/viewController.js';\nimport { EditorZoom } from '../../common/config/editorZoom.js';\nimport { Position } from '../../common/core/position.js';\nimport { Selection } from '../../common/core/selection.js';\nimport { HorizontalPosition } from '../view/renderingContext.js';\nimport { ViewContext } from '../../common/viewModel/viewContext.js';\nimport * as viewEvents from '../../common/viewEvents.js';\nimport { ViewEventHandler } from '../../common/viewEventHandler.js';\nimport { EditorOption } from '../../common/config/editorOptions.js';\nimport { NavigationCommandRevealType } from '../coreCommands.js';\nimport { MouseWheelClassifier } from '../../../base/browser/ui/scrollbar/scrollableElement.js';\nimport { ViewLinesGpu } from '../viewParts/viewLinesGpu/viewLinesGpu.js';\nimport { TopBottomDragScrolling, LeftRightDragScrolling } from './dragScrolling.js';\n\nexport interface IPointerHandlerHelper {\n\tviewDomNode: HTMLElement;\n\tlinesContentDomNode: HTMLElement;\n\tviewLinesDomNode: HTMLElement;\n\tviewLinesGpu: ViewLinesGpu | undefined;\n\n\tfocusTextArea(): void;\n\tdispatchTextAreaEvent(event: CustomEvent): void;\n\n\t/**\n\t * Get the last rendered information for cursors & textarea.\n\t */\n\tgetLastRenderData(): PointerHandlerLastRenderData;\n\n\t/**\n\t * Render right now\n\t */\n\trenderNow(): void;\n\n\tshouldSuppressMouseDownOnViewZone(viewZoneId: string): boolean;\n\tshouldSuppressMouseDownOnWidget(widgetId: string): boolean;\n\n\t/**\n\t * Decode a position from a rendered dom node\n\t */\n\tgetPositionFromDOMInfo(spanNode: HTMLElement, offset: number): Position | null;\n\n\tvisibleRangeForPosition(lineNumber: number, column: number): HorizontalPosition | null;\n\tgetLineWidth(lineNumber: number): number;\n}\n\nexport class MouseHandler extends ViewEventHandler {\n\n\tprotected _context: ViewContext;\n\tprotected viewController: ViewController;\n\tprotected viewHelper: IPointerHandlerHelper;\n\tprotected mouseTargetFactory: MouseTargetFactory;\n\tprotected readonly _mouseDownOperation: MouseDownOperation;\n\tprivate lastMouseLeaveTime: number;\n\tprivate _height: number;\n\tprivate _mouseLeaveMonitor: IDisposable | null = null;\n\n\tconstructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {\n\t\tsuper();\n\n\t\tthis._context = context;\n\t\tthis.viewController = viewController;\n\t\tthis.viewHelper = viewHelper;\n\t\tthis.mouseTargetFactory = new MouseTargetFactory(this._context, viewHelper);\n\n\t\tthis._mouseDownOperation = this._register(new MouseDownOperation(\n\t\t\tthis._context,\n\t\t\tthis.viewController,\n\t\t\tthis.viewHelper,\n\t\t\tthis.mouseTargetFactory,\n\t\t\t(e, testEventTarget) => this._createMouseTarget(e, testEventTarget),\n\t\t\t(e) => this._getMouseColumn(e)\n\t\t));\n\n\t\tthis.lastMouseLeaveTime = -1;\n\t\tthis._height = this._context.configuration.options.get(EditorOption.layoutInfo).height;\n\n\t\tconst mouseEvents = new EditorMouseEventFactory(this.viewHelper.viewDomNode);\n\n\t\tthis._register(mouseEvents.onContextMenu(this.viewHelper.viewDomNode, (e) => this._onContextMenu(e, true)));\n\n\t\tthis._register(mouseEvents.onMouseMove(this.viewHelper.viewDomNode, (e) => {\n\t\t\tthis._onMouseMove(e);\n\n\t\t\t// See https://github.com/microsoft/vscode/issues/138789\n\t\t\t// When moving the mouse really quickly, the browser sometimes forgets to\n\t\t\t// send us a `mouseleave` or `mouseout` event. We therefore install here\n\t\t\t// a global `mousemove` listener to manually recover if the mouse goes outside\n\t\t\t// the editor. As soon as the mouse leaves outside of the editor, we\n\t\t\t// remove this listener\n\n\t\t\tif (!this._mouseLeaveMonitor) {\n\t\t\t\tthis._mouseLeaveMonitor = dom.addDisposableListener(this.viewHelper.viewDomNode.ownerDocument, 'mousemove', (e) => {\n\t\t\t\t\tif (!this.viewHelper.viewDomNode.contains(e.target as Node | null)) {\n\t\t\t\t\t\t// went outside the editor!\n\t\t\t\t\t\tthis._onMouseLeave(new EditorMouseEvent(e, false, this.viewHelper.viewDomNode));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}));\n\n\t\tthis._register(mouseEvents.onMouseUp(this.viewHelper.viewDomNode, (e) => this._onMouseUp(e)));\n\n\t\tthis._register(mouseEvents.onMouseLeave(this.viewHelper.viewDomNode, (e) => this._onMouseLeave(e)));\n\n\t\t// `pointerdown` events can't be used to determine if there's a double click, or triple click\n\t\t// because their `e.detail` is always 0.\n\t\t// We will therefore save the pointer id for the mouse and then reuse it in the `mousedown` event\n\t\t// for `element.setPointerCapture`.\n\t\tlet capturePointerId: number = 0;\n\t\tthis._register(mouseEvents.onPointerDown(this.viewHelper.viewDomNode, (e, pointerId) => {\n\t\t\tcapturePointerId = pointerId;\n\t\t}));\n\t\t// The `pointerup` listener registered by `GlobalEditorPointerMoveMonitor` does not get invoked 100% of the times.\n\t\t// I speculate that this is because the `pointerup` listener is only registered during the `mousedown` event, and perhaps\n\t\t// the `pointerup` event is already queued for dispatching, which makes it that the new listener doesn't get fired.\n\t\t// See https://github.com/microsoft/vscode/issues/146486 for repro steps.\n\t\t// To compensate for that, we simply register here a `pointerup` listener and just communicate it.\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.POINTER_UP, (e: PointerEvent) => {\n\t\t\tthis._mouseDownOperation.onPointerUp();\n\t\t}));\n\t\tthis._register(mouseEvents.onMouseDown(this.viewHelper.viewDomNode, (e) => this._onMouseDown(e, capturePointerId)));\n\t\tthis._setupMouseWheelZoomListener();\n\n\t\tthis._context.addEventHandler(this);\n\t}\n\n\tprivate _setupMouseWheelZoomListener(): void {\n\n\t\tconst classifier = MouseWheelClassifier.INSTANCE;\n\n\t\tlet prevMouseWheelTime = 0;\n\t\tlet gestureStartZoomLevel = EditorZoom.getZoomLevel();\n\t\tlet gestureHasZoomModifiers = false;\n\t\tlet gestureAccumulatedDelta = 0;\n\n\t\tconst onMouseWheel = (browserEvent: IMouseWheelEvent) => {\n\t\t\tthis.viewController.emitMouseWheel(browserEvent);\n\n\t\t\tif (!this._context.configuration.options.get(EditorOption.mouseWheelZoom)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst e = new StandardWheelEvent(browserEvent);\n\t\t\tclassifier.acceptStandardWheelEvent(e);\n\n\t\t\tif (classifier.isPhysicalMouseWheel()) {\n\t\t\t\tif (hasMouseWheelZoomModifiers(browserEvent)) {\n\t\t\t\t\tconst zoomLevel: number = EditorZoom.getZoomLevel();\n\t\t\t\t\tconst delta = e.deltaY > 0 ? 1 : -1;\n\t\t\t\t\tEditorZoom.setZoomLevel(zoomLevel + delta);\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// we consider mousewheel events that occur within 50ms of each other to be part of the same gesture\n\t\t\t\t// we don't want to consider mouse wheel events where ctrl/cmd is pressed during the inertia phase\n\t\t\t\t// we also want to accumulate deltaY values from the same gesture and use that to set the zoom level\n\t\t\t\tif (Date.now() - prevMouseWheelTime > 50) {\n\t\t\t\t\t// reset if more than 50ms have passed\n\t\t\t\t\tgestureStartZoomLevel = EditorZoom.getZoomLevel();\n\t\t\t\t\tgestureHasZoomModifiers = hasMouseWheelZoomModifiers(browserEvent);\n\t\t\t\t\tgestureAccumulatedDelta = 0;\n\t\t\t\t}\n\n\t\t\t\tprevMouseWheelTime = Date.now();\n\t\t\t\tgestureAccumulatedDelta += e.deltaY;\n\n\t\t\t\tif (gestureHasZoomModifiers) {\n\t\t\t\t\tEditorZoom.setZoomLevel(gestureStartZoomLevel + gestureAccumulatedDelta / 5);\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis._register(dom.addDisposableListener(this.viewHelper.viewDomNode, dom.EventType.MOUSE_WHEEL, onMouseWheel, { capture: true, passive: false }));\n\n\t\tfunction hasMouseWheelZoomModifiers(browserEvent: IMouseWheelEvent): boolean {\n\t\t\treturn (\n\t\t\t\tplatform.isMacintosh\n\t\t\t\t\t// on macOS we support cmd + two fingers scroll (`metaKey` set)\n\t\t\t\t\t// and also the two fingers pinch gesture (`ctrKey` set)\n\t\t\t\t\t? ((browserEvent.metaKey || browserEvent.ctrlKey) && !browserEvent.shiftKey && !browserEvent.altKey)\n\t\t\t\t\t: (browserEvent.ctrlKey && !browserEvent.metaKey && !browserEvent.shiftKey && !browserEvent.altKey)\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic override dispose(): void {\n\t\tthis._context.removeEventHandler(this);\n\t\tif (this._mouseLeaveMonitor) {\n\t\t\tthis._mouseLeaveMonitor.dispose();\n\t\t\tthis._mouseLeaveMonitor = null;\n\t\t}\n\t\tsuper.dispose();\n\t}\n\n\t// --- begin event handlers\n\tpublic override onConfigurationChanged(e: viewEvents.ViewConfigurationChangedEvent): boolean {\n\t\tif (e.hasChanged(EditorOption.layoutInfo)) {\n\t\t\t// layout change\n\t\t\tconst height = this._context.configuration.options.get(EditorOption.layoutInfo).height;\n\t\t\tif (this._height !== height) {\n\t\t\t\tthis._height = height;\n\t\t\t\tthis._mouseDownOperation.onHeightChanged();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tpublic override onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): boolean {\n\t\tthis._mouseDownOperation.onCursorStateChanged(e);\n\t\treturn false;\n\t}\n\tpublic override onFocusChanged(e: viewEvents.ViewFocusChangedEvent): boolean {\n\t\treturn false;\n\t}\n\t// --- end event handlers\n\n\tpublic getTargetAtClientPoint(clientX: number, clientY: number): IMouseTarget | null {\n\t\tconst clientPos = new ClientCoordinates(clientX, clientY);\n\t\tconst pos = clientPos.toPageCoordinates(dom.getWindow(this.viewHelper.viewDomNode));\n\t\tconst editorPos = createEditorPagePosition(this.viewHelper.viewDomNode);\n\n\t\tif (pos.y < editorPos.y || pos.y > editorPos.y + editorPos.height || pos.x < editorPos.x || pos.x > editorPos.x + editorPos.width) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst relativePos = createCoordinatesRelativeToEditor(this.viewHelper.viewDomNode, editorPos, pos);\n\t\treturn this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), editorPos, pos, relativePos, null);\n\t}\n\n\tprotected _createMouseTarget(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget {\n\t\tlet target: HTMLElement | null = e.target;\n\t\tif (!this.viewHelper.viewDomNode.contains(target)) {\n\t\t\tconst shadowRoot = dom.getShadowRoot(this.viewHelper.viewDomNode);\n\t\t\tif (shadowRoot) {\n\t\t\t\tconst potentialTarget = shadowRoot.elementsFromPoint(e.posx, e.posy).find(\n\t\t\t\t\t(el: Element) => this.viewHelper.viewDomNode.contains(el)\n\t\t\t\t) ?? null;\n\t\t\t\ttarget = potentialTarget as HTMLElement;\n\t\t\t}\n\t\t}\n\t\treturn this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(), e.editorPos, e.pos, e.relativePos, testEventTarget ? target : null);\n\t}\n\n\tprivate _getMouseColumn(e: EditorMouseEvent): number {\n\t\treturn this.mouseTargetFactory.getMouseColumn(e.relativePos);\n\t}\n\n\tprotected _onContextMenu(e: EditorMouseEvent, testEventTarget: boolean): void {\n\t\tthis.viewController.emitContextMenu({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, testEventTarget)\n\t\t});\n\t}\n\n\tprotected _onMouseMove(e: EditorMouseEvent): void {\n\t\tconst targetIsWidget = this.mouseTargetFactory.mouseTargetIsWidget(e);\n\t\tif (!targetIsWidget) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (this._mouseDownOperation.isActive()) {\n\t\t\t// In selection/drag operation\n\t\t\treturn;\n\t\t}\n\t\tconst actualMouseMoveTime = e.timestamp;\n\t\tif (actualMouseMoveTime < this.lastMouseLeaveTime) {\n\t\t\t// Due to throttling, this event occurred before the mouse left the editor, therefore ignore it.\n\t\t\treturn;\n\t\t}\n\n\t\tthis.viewController.emitMouseMove({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, true)\n\t\t});\n\t}\n\n\tprotected _onMouseLeave(e: EditorMouseEvent): void {\n\t\tif (this._mouseLeaveMonitor) {\n\t\t\tthis._mouseLeaveMonitor.dispose();\n\t\t\tthis._mouseLeaveMonitor = null;\n\t\t}\n\t\tthis.lastMouseLeaveTime = (new Date()).getTime();\n\t\tthis.viewController.emitMouseLeave({\n\t\t\tevent: e,\n\t\t\ttarget: null\n\t\t});\n\t}\n\n\tprotected _onMouseUp(e: EditorMouseEvent): void {\n\t\tthis.viewController.emitMouseUp({\n\t\t\tevent: e,\n\t\t\ttarget: this._createMouseTarget(e, true)\n\t\t});\n\t}\n\n\tprotected _onMouseDown(e: EditorMouseEvent, pointerId: number): void {\n\t\tconst t = this._createMouseTarget(e, true);\n\n\t\tconst targetIsContent = (t.type === MouseTargetType.CONTENT_TEXT || t.type === MouseTargetType.CONTENT_EMPTY);\n\t\tconst targetIsGutter = (t.type === MouseTargetType.GUTTER_GLYPH_MARGIN || t.type === MouseTargetType.GUTTER_LINE_NUMBERS || t.type === MouseTargetType.GUTTER_LINE_DECORATIONS);\n\t\tconst targetIsLineNumbers = (t.type === MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tconst selectOnLineNumbers = this._context.configuration.options.get(EditorOption.selectOnLineNumbers);\n\t\tconst targetIsViewZone = (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE);\n\t\tconst targetIsWidget = (t.type === MouseTargetType.CONTENT_WIDGET);\n\n\t\tlet shouldHandle = e.leftButton || e.middleButton;\n\t\tif (platform.isMacintosh && e.leftButton && e.ctrlKey) {\n\t\t\tshouldHandle = false;\n\t\t}\n\n\t\tconst focus = () => {\n\t\t\te.preventDefault();\n\t\t\tthis.viewHelper.focusTextArea();\n\t\t};\n\n\t\tif (shouldHandle && (targetIsContent || (targetIsLineNumbers && selectOnLineNumbers))) {\n\t\t\tfocus();\n\t\t\tthis._mouseDownOperation.start(t.type, e, pointerId);\n\n\t\t} else if (targetIsGutter) {\n\t\t\t// Do not steal focus\n\t\t\te.preventDefault();\n\t\t} else if (targetIsViewZone) {\n\t\t\tconst viewZoneData = t.detail;\n\t\t\tif (shouldHandle && this.viewHelper.shouldSuppressMouseDownOnViewZone(viewZoneData.viewZoneId)) {\n\t\t\t\tfocus();\n\t\t\t\tthis._mouseDownOperation.start(t.type, e, pointerId);\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t} else if (targetIsWidget && this.viewHelper.shouldSuppressMouseDownOnWidget(<string>t.detail)) {\n\t\t\tfocus();\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tthis.viewController.emitMouseDown({\n\t\t\tevent: e,\n\t\t\ttarget: t\n\t\t});\n\t}\n}\n\nclass MouseDownOperation extends Disposable {\n\n\tprivate readonly _createMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget;\n\tprivate readonly _getMouseColumn: (e: EditorMouseEvent) => number;\n\n\tprivate readonly _mouseMoveMonitor: GlobalEditorPointerMoveMonitor;\n\tprivate readonly _topBottomDragScrolling: TopBottomDragScrolling;\n\tprivate readonly _leftRightDragScrolling: LeftRightDragScrolling;\n\tprivate readonly _mouseState: MouseDownState;\n\n\tprivate _currentSelection: Selection;\n\tprivate _isActive: boolean;\n\tprivate _lastMouseEvent: EditorMouseEvent | null;\n\n\tconstructor(\n\t\tprivate readonly _context: ViewContext,\n\t\tprivate readonly _viewController: ViewController,\n\t\tprivate readonly _viewHelper: IPointerHandlerHelper,\n\t\tprivate readonly _mouseTargetFactory: MouseTargetFactory,\n\t\tcreateMouseTarget: (e: EditorMouseEvent, testEventTarget: boolean) => IMouseTarget,\n\t\tgetMouseColumn: (e: EditorMouseEvent) => number\n\t) {\n\t\tsuper();\n\t\tthis._createMouseTarget = createMouseTarget;\n\t\tthis._getMouseColumn = getMouseColumn;\n\n\t\tthis._mouseMoveMonitor = this._register(new GlobalEditorPointerMoveMonitor(this._viewHelper.viewDomNode));\n\t\tthis._topBottomDragScrolling = this._register(new TopBottomDragScrolling(\n\t\t\tthis._context,\n\t\t\tthis._viewHelper,\n\t\t\tthis._mouseTargetFactory,\n\t\t\t(position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)\n\t\t));\n\t\tthis._leftRightDragScrolling = this._register(new LeftRightDragScrolling(\n\t\t\tthis._context,\n\t\t\tthis._viewHelper,\n\t\t\tthis._mouseTargetFactory,\n\t\t\t(position, inSelectionMode, revealType) => this._dispatchMouse(position, inSelectionMode, revealType)\n\t\t));\n\t\tthis._mouseState = new MouseDownState();\n\n\t\tthis._currentSelection = new Selection(1, 1, 1, 1);\n\t\tthis._isActive = false;\n\t\tthis._lastMouseEvent = null;\n\t}\n\n\tpublic override dispose(): void {\n\t\tsuper.dispose();\n\t}\n\n\tpublic isActive(): boolean {\n\t\treturn this._isActive;\n\t}\n\n\tprivate _onMouseDownThenMove(e: EditorMouseEvent): void {\n\t\tthis._lastMouseEvent = e;\n\t\tthis._mouseState.setModifiers(e);\n\n\t\tconst position = this._findMousePosition(e, false);\n\t\tif (!position) {\n\t\t\t// Ignoring because position is unknown\n\t\t\treturn;\n\t\t}\n\n\t\tif (this._mouseState.isDragAndDrop) {\n\t\t\tthis._viewController.emitMouseDrag({\n\t\t\t\tevent: e,\n\t\t\t\ttarget: position\n\t\t\t});\n\t\t} else {\n\t\t\tif (position.type === MouseTargetType.OUTSIDE_EDITOR) {\n\t\t\t\tif (position.outsidePosition === 'above' || position.outsidePosition === 'below') {\n\t\t\t\t\tthis._topBottomDragScrolling.start(position, e);\n\t\t\t\t\tthis._leftRightDragScrolling.stop();\n\t\t\t\t} else {\n\t\t\t\t\tthis._leftRightDragScrolling.start(position, e);\n\t\t\t\t\tthis._topBottomDragScrolling.stop();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis._topBottomDragScrolling.stop();\n\t\t\t\tthis._leftRightDragScrolling.stop();\n\t\t\t\tthis._dispatchMouse(position, true, NavigationCommandRevealType.Minimal);\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic start(targetType: MouseTargetType, e: EditorMouseEvent, pointerId: number): void {\n\t\tthis._lastMouseEvent = e;\n\n\t\tthis._mouseState.setStartedOnLineNumbers(targetType === MouseTargetType.GUTTER_LINE_NUMBERS);\n\t\tthis._mouseState.setStartButtons(e);\n\t\tthis._mouseState.setModifiers(e);\n\t\tconst position = this._findMousePosition(e, true);\n\t\tif (!position || !position.position) {\n\t\t\t// Ignoring because position is unknown\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseState.trySetCount(e.detail, position.position);\n\n\t\t// Overwrite the detail of the MouseEvent, as it will be sent out in an event and contributions might rely on it.\n\t\te.detail = this._mouseState.count;\n\n\t\tconst options = this._context.configuration.options;\n\n\t\tif (!options.get(EditorOption.readOnly)\n\t\t\t&& options.get(EditorOption.dragAndDrop)\n\t\t\t&& !options.get(EditorOption.columnSelection)\n\t\t\t&& !this._mouseState.altKey // we don't support multiple mouse\n\t\t\t&& e.detail < 2 // only single click on a selection can work\n\t\t\t&& !this._isActive // the mouse is not down yet\n\t\t\t&& !this._currentSelection.isEmpty() // we don't drag single cursor\n\t\t\t&& (position.type === MouseTargetType.CONTENT_TEXT) // single click on text\n\t\t\t&& position.position && this._currentSelection.containsPosition(position.position) // single click on a selection\n\t\t) {\n\t\t\tthis._mouseState.isDragAndDrop = true;\n\t\t\tthis._isActive = true;\n\n\t\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\t\tthis._viewHelper.viewLinesDomNode,\n\t\t\t\tpointerId,\n\t\t\t\te.buttons,\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t(browserEvent?: MouseEvent | KeyboardEvent) => {\n\t\t\t\t\tconst position = this._findMousePosition(this._lastMouseEvent!, false);\n\n\t\t\t\t\tif (dom.isKeyboardEvent(browserEvent)) {\n\t\t\t\t\t\t// cancel\n\t\t\t\t\t\tthis._viewController.emitMouseDropCanceled();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._viewController.emitMouseDrop({\n\t\t\t\t\t\t\tevent: this._lastMouseEvent!,\n\t\t\t\t\t\t\ttarget: (position ? this._createMouseTarget(this._lastMouseEvent!, true) : null) // Ignoring because position is unknown, e.g., Content View Zone\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._stop();\n\t\t\t\t}\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis._mouseState.isDragAndDrop = false;\n\t\tthis._dispatchMouse(position, e.shiftKey, NavigationCommandRevealType.Minimal);\n\n\t\tif (!this._isActive) {\n\t\t\tthis._isActive = true;\n\t\t\tthis._mouseMoveMonitor.startMonitoring(\n\t\t\t\tthis._viewHelper.viewLinesDomNode,\n\t\t\t\tpointerId,\n\t\t\t\te.buttons,\n\t\t\t\t(e) => this._onMouseDownThenMove(e),\n\t\t\t\t() => this._stop()\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate _stop(): void {\n\t\tthis._isActive = false;\n\t\tthis._topBottomDragScrolling.stop();\n\t\tthis._leftRightDragScrolling.stop();\n\t}\n\n\tpublic onHeightChanged(): void {\n\t\tthis._mouseMoveMonitor.stopMonitoring();\n\t}\n\n\tpublic onPointerUp(): void {\n\t\tthis._mouseMoveMonitor.stopMonitoring();\n\t}\n\n\tpublic onCursorStateChanged(e: viewEvents.ViewCursorStateChangedEvent): void {\n\t\tthis._currentSelection = e.selections[0];\n\t}\n\n\tprivate _getPositionOutsideEditor(e: EditorMouseEvent): IMouseTarget | null {\n\t\tconst editorContent = e.editorPos;\n\t\tconst model = this._context.viewModel;\n\t\tconst viewLayout = this._context.viewLayout;\n\n\t\tconst mouseColumn = this._getMouseColumn(e);\n\n\t\tif (e.posy < editorContent.y) {\n\t\t\tconst outsideDistance = editorContent.y - e.posy;\n\t\t\tconst verticalOffset = Math.max(viewLayout.getCurrentScrollTop() - outsideDistance, 0);\n\t\t\tconst viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n\t\t\tif (viewZoneData) {\n\t\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n\t\t\t\tif (newPosition) {\n\t\t\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, newPosition, 'above', outsideDistance);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst aboveLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(aboveLineNumber, 1), 'above', outsideDistance);\n\t\t}\n\n\t\tif (e.posy > editorContent.y + editorContent.height) {\n\t\t\tconst outsideDistance = e.posy - editorContent.y - editorContent.height;\n\t\t\tconst verticalOffset = viewLayout.getCurrentScrollTop() + e.relativePos.y;\n\t\t\tconst viewZoneData = HitTestContext.getZoneAtCoord(this._context, verticalOffset);\n\t\t\tif (viewZoneData) {\n\t\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(viewZoneData);\n\t\t\t\tif (newPosition) {\n\t\t\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, newPosition, 'below', outsideDistance);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst belowLineNumber = viewLayout.getLineNumberAtVerticalOffset(verticalOffset);\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(belowLineNumber, model.getLineMaxColumn(belowLineNumber)), 'below', outsideDistance);\n\t\t}\n\n\t\tconst possibleLineNumber = viewLayout.getLineNumberAtVerticalOffset(viewLayout.getCurrentScrollTop() + e.relativePos.y);\n\n\t\tconst layoutInfo = this._context.configuration.options.get(EditorOption.layoutInfo);\n\n\t\tconst xLeftBoundary = layoutInfo.contentLeft;\n\t\tif (e.relativePos.x <= xLeftBoundary) {\n\t\t\tconst outsideDistance = xLeftBoundary - e.relativePos.x;\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, 1), 'left', outsideDistance);\n\t\t}\n\n\t\tconst contentRight = (\n\t\t\tlayoutInfo.minimap.minimapLeft === 0\n\t\t\t\t? layoutInfo.width - layoutInfo.verticalScrollbarWidth // Happens when minimap is hidden\n\t\t\t\t: layoutInfo.minimap.minimapLeft\n\t\t);\n\t\tconst xRightBoundary = contentRight;\n\t\tif (e.relativePos.x >= xRightBoundary) {\n\t\t\tconst outsideDistance = e.relativePos.x - xRightBoundary;\n\t\t\treturn MouseTarget.createOutsideEditor(mouseColumn, new Position(possibleLineNumber, model.getLineMaxColumn(possibleLineNumber)), 'right', outsideDistance);\n\t\t}\n\n\t\treturn null;\n\t}\n\n\tprivate _findMousePosition(e: EditorMouseEvent, testEventTarget: boolean): IMouseTarget | null {\n\t\tconst positionOutsideEditor = this._getPositionOutsideEditor(e);\n\t\tif (positionOutsideEditor) {\n\t\t\treturn positionOutsideEditor;\n\t\t}\n\n\t\tconst t = this._createMouseTarget(e, testEventTarget);\n\t\tconst hintedPosition = t.position;\n\t\tif (!hintedPosition) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (t.type === MouseTargetType.CONTENT_VIEW_ZONE || t.type === MouseTargetType.GUTTER_VIEW_ZONE) {\n\t\t\tconst newPosition = this._helpPositionJumpOverViewZone(t.detail);\n\t\t\tif (newPosition) {\n\t\t\t\treturn MouseTarget.createViewZone(t.type, t.element, t.mouseColumn, newPosition, t.detail);\n\t\t\t}\n\t\t}\n\n\t\treturn t;\n\t}\n\n\tprivate _helpPositionJumpOverViewZone(viewZoneData: IMouseTargetViewZoneData): Position | null {\n\t\t// Force position on view zones to go above or below depending on where selection started from\n\t\tconst selectionStart = new Position(this._currentSelection.selectionStartLineNumber, this._currentSelection.selectionStartColumn);\n\t\tconst positionBefore = viewZoneData.positionBefore;\n\t\tconst positionAfter = viewZoneData.positionAfter;\n\n\t\tif (positionBefore && positionAfter) {\n\t\t\tif (positionBefore.isBefore(selectionStart)) {\n\t\t\t\treturn positionBefore;\n\t\t\t} else {\n\t\t\t\treturn positionAfter;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate _dispatchMouse(position: IMouseTarget, inSelectionMode: boolean, revealType: NavigationCommandRevealType): void {\n\t\tif (!position.position) {\n\t\t\treturn;\n\t\t}\n\t\tthis._viewController.dispatchMouse({\n\t\t\tposition: position.position,\n\t\t\tmouseColumn: position.mouseColumn,\n\t\t\tstartedOnLineNumbers: this._mouseState.startedOnLineNumbers,\n\t\t\trevealType,\n\n\t\t\tinSelectionMode: inSelectionMode,\n\t\t\tmouseDownCount: this._mouseState.count,\n\t\t\taltKey: this._mouseState.altKey,\n\t\t\tctrlKey: this._mouseState.ctrlKey,\n\t\t\tmetaKey: this._mouseState.metaKey,\n\t\t\tshiftKey: this._mouseState.shiftKey,\n\n\t\t\tleftButton: this._mouseState.leftButton,\n\t\t\tmiddleButton: this._mouseState.middleButton,\n\n\t\t\tonInjectedText: position.type === MouseTargetType.CONTENT_TEXT && position.detail.injectedText !== null\n\t\t});\n\t}\n}\n\nclass MouseDownState {\n\n\tprivate static readonly CLEAR_MOUSE_DOWN_COUNT_TIME = 400; // ms\n\n\tprivate _altKey: boolean;\n\tpublic get altKey(): boolean { return this._altKey; }\n\n\tprivate _ctrlKey: boolean;\n\tpublic get ctrlKey(): boolean { return this._ctrlKey; }\n\n\tprivate _metaKey: boolean;\n\tpublic get metaKey(): boolean { return this._metaKey; }\n\n\tprivate _shiftKey: boolean;\n\tpublic get shiftKey(): boolean { return this._shiftKey; }\n\n\tprivate _leftButton: boolean;\n\tpublic get leftButton(): boolean { return this._leftButton; }\n\n\tprivate _middleButton: boolean;\n\tpublic get middleButton(): boolean { return this._middleButton; }\n\n\tprivate _startedOnLineNumbers: boolean;\n\tpublic get startedOnLineNumbers(): boolean { return this._startedOnLineNumbers; }\n\n\tprivate _lastMouseDownPosition: Position | null;\n\tprivate _lastMouseDownPositionEqualCount: number;\n\tprivate _lastMouseDownCount: number;\n\tprivate _lastSetMouseDownCountTime: number;\n\tpublic isDragAndDrop: boolean;\n\n\tconstructor() {\n\t\tthis._altKey = false;\n\t\tthis._ctrlKey = false;\n\t\tthis._metaKey = false;\n\t\tthis._shiftKey = false;\n\t\tthis._leftButton = false;\n\t\tthis._middleButton = false;\n\t\tthis._startedOnLineNumbers = false;\n\t\tthis._lastMouseDownPosition = null;\n\t\tthis._lastMouseDownPositionEqualCount = 0;\n\t\tthis._lastMouseDownCount = 0;\n\t\tthis._lastSetMouseDownCountTime = 0;\n\t\tthis.isDragAndDrop = false;\n\t}\n\n\tpublic get count(): number {\n\t\treturn this._lastMouseDownCount;\n\t}\n\n\tpublic setModifiers(source: EditorMouseEvent) {\n\t\tthis._altKey = source.altKey;\n\t\tthis._ctrlKey = source.ctrlKey;\n\t\tthis._metaKey = source.metaKey;\n\t\tthis._shiftKey = source.shiftKey;\n\t}\n\n\tpublic setStartButtons(source: EditorMouseEvent) {\n\t\tthis._leftButton = source.leftButton;\n\t\tthis._middleButton = source.middleButton;\n\t}\n\n\tpublic setStartedOnLineNumbers(startedOnLineNumbers: boolean): void {\n\t\tthis._startedOnLineNumbers = startedOnLineNumbers;\n\t}\n\n\tpublic trySetCount(setMouseDownCount: number, newMouseDownPosition: Position): void {\n\t\t// a. Invalidate multiple clicking if too much time has passed (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n\t\tconst currentTime = (new Date()).getTime();\n\t\tif (currentTime - this._lastSetMouseDownCountTime > MouseDownState.CLEAR_MOUSE_DOWN_COUNT_TIME) {\n\t\t\tsetMouseDownCount = 1;\n\t\t}\n\t\tthis._lastSetMouseDownCountTime = currentTime;\n\n\t\t// b. Ensure that we don't jump from single click to triple click in one go (will be hit by IE because the detail field of mouse events contains garbage in IE10)\n\t\tif (setMouseDownCount > this._lastMouseDownCount + 1) {\n\t\t\tsetMouseDownCount = this._lastMouseDownCount + 1;\n\t\t}\n\n\t\t// c. Invalidate multiple clicking if the logical position is different\n\t\tif (this._lastMouseDownPosition && this._lastMouseDownPosition.equals(newMouseDownPosition)) {\n\t\t\tthis._lastMouseDownPositionEqualCount++;\n\t\t} else {\n\t\t\tthis._lastMouseDownPositionEqualCount = 1;\n\t\t}\n\t\tthis._lastMouseDownPosition = newMouseDownPosition;\n\n\t\t// Finally set the lastMouseDownCount\n\t\tthis._lastMouseDownCount = Math.min(setMouseDownCount, this._lastMouseDownPositionEqualCount);\n\t}\n\n}\n"]}
@@ -775,14 +775,17 @@ export class MouseTargetFactory {
775
775
  const shadowRoot = dom.getShadowRoot(ctx.viewDomNode);
776
776
  let range;
777
777
  if (shadowRoot) {
778
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
778
779
  if (typeof shadowRoot.caretRangeFromPoint === 'undefined') {
779
780
  range = shadowCaretRangeFromPoint(shadowRoot, coords.clientX, coords.clientY);
780
781
  }
781
782
  else {
783
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
782
784
  range = shadowRoot.caretRangeFromPoint(coords.clientX, coords.clientY);
783
785
  }
784
786
  }
785
787
  else {
788
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
786
789
  range = ctx.viewDomNode.ownerDocument.caretRangeFromPoint(coords.clientX, coords.clientY);
787
790
  }
788
791
  if (!range || !range.startContainer) {
@@ -821,6 +824,7 @@ export class MouseTargetFactory {
821
824
  * Most probably Gecko
822
825
  */
823
826
  static _doHitTestWithCaretPositionFromPoint(ctx, coords) {
827
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
824
828
  const hitResult = ctx.viewDomNode.ownerDocument.caretPositionFromPoint(coords.clientX, coords.clientY);
825
829
  if (hitResult.offsetNode.nodeType === hitResult.offsetNode.TEXT_NODE) {
826
830
  // offsetNode is expected to be the token text
@@ -867,8 +871,10 @@ export class MouseTargetFactory {
867
871
  }
868
872
  static doHitTest(ctx, request) {
869
873
  let result = new UnknownHitTestResult();
874
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
870
875
  if (typeof ctx.viewDomNode.ownerDocument.caretRangeFromPoint === 'function') {
871
876
  result = this._doHitTestWithCaretRangeFromPoint(ctx, request);
877
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
872
878
  }
873
879
  else if (ctx.viewDomNode.ownerDocument.caretPositionFromPoint) {
874
880
  result = this._doHitTestWithCaretPositionFromPoint(ctx, request.pos.toClientCoordinates(dom.getWindow(ctx.viewDomNode)));
@@ -886,6 +892,7 @@ export class MouseTargetFactory {
886
892
  function shadowCaretRangeFromPoint(shadowRoot, x, y) {
887
893
  const range = document.createRange();
888
894
  // Get the element under the point
895
+ // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any
889
896
  let el = shadowRoot.elementFromPoint(x, y);
890
897
  // When el is not null, it may be div.monaco-mouse-cursor-text Element, which has not childNodes, we don't need to handle it.
891
898
  if (el?.hasChildNodes()) {