Conversation
Co-authored-by: joaomoreno <22350+joaomoreno@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Disable 'Reveal Markdown Source' on Double Click in CopilotMD Files
Disable double-click to reveal source for .copilotmd files in markdown preview
Sep 19, 2025
joaomoreno
approved these changes
Sep 22, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR disables the double-click to reveal source functionality specifically for .copilotmd files in the markdown preview, while preserving the existing behavior for regular .md files.
- Adds a file extension check to prevent double-click source reveal for
.copilotmdfiles - Maintains all existing double-click behavior for standard markdown files
- Uses early return pattern to exit the event handler when dealing with copilotmd files
Member
|
Does this work in Copilot Instuctions files which have the Language Type of "Instructions" and not "Markdown"? |
Member
|
It only works if the file has file extension |
chrmarti
previously approved these changes
Sep 30, 2025
joaomoreno
reviewed
Oct 3, 2025
benibenj
approved these changes
Oct 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR disables the double-click behavior that reveals markdown source for files with the
.copilotmdextension, while preserving all existing functionality for regular.mdfiles.Problem
Currently, double-clicking in the markdown preview reveals the source markdown for all markdown files. For
.copilotmdfiles, this behavior should be disabled to prevent users from accidentally switching to the source view.Solution
Added a file extension check in the double-click event listener in
extensions/markdown-language-features/preview-src/index.ts. The implementation:.copilotmdImpact
.copilotmdfiles: Double-click no longer reveals markdown source.mdfiles: Double-click behavior unchanged (still reveals source)This is a minimal, surgical change that addresses the specific requirement without affecting existing functionality.
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.