mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Disable double-click to reveal source for .copilotmd files in markdown preview (#267517)
* Initial plan * Disable double-click behavior for .copilotmd files in markdown preview Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com> * Update extensions/markdown-language-features/preview-src/index.ts --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com> Co-authored-by: João Moreno <joaomoreno@users.noreply.github.com>
This commit is contained in:
@@ -304,6 +304,11 @@ document.addEventListener('dblclick', event => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Disable double-click to switch editor for .copilotmd files
|
||||
if (documentResource.endsWith('.copilotmd')) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Ignore clicks on links
|
||||
for (let node = event.target as HTMLElement; node; node = node.parentNode as HTMLElement) {
|
||||
if (node.tagName === 'A') {
|
||||
|
||||
Reference in New Issue
Block a user