Skip to content

Comments

feat: allow custom markdown preview command#1

Open
m-hesse wants to merge 6 commits intoKnworks:mainfrom
m-hesse:feature/custom-preview-command
Open

feat: allow custom markdown preview command#1
m-hesse wants to merge 6 commits intoKnworks:mainfrom
m-hesse:feature/custom-preview-command

Conversation

@m-hesse
Copy link

@m-hesse m-hesse commented Feb 16, 2026

Summary

  • Adds two new configuration settings (previewCommand and previewViewType) that allow users to replace the built-in VS Code Markdown preview with any third-party preview extension (e.g. Markdown Preview Enhanced)
  • The preview tab detection for lock/close logic is now driven by the configurable previewViewType instead of being hardcoded to the built-in preview
  • When switching between Markdown files, the existing preview tab is reused in place rather than closed and reopened, preserving the user's panel sizing

Configuration

"auto-markdown-preview-lock.previewCommand": "markdown-preview-enhanced.openPreviewToTheSide",
"auto-markdown-preview-lock.previewViewType": "markdown-preview-enhanced"
Setting Default Description
previewCommand markdown.showPreviewToSide The command ID used to open the preview
previewViewType markdown.preview The webview viewType used to identify the preview tab

Test plan

  • Verify default behavior (built-in preview) still works as before
  • Set previewCommand and previewViewType to MPE values and confirm preview opens to the side
  • Confirm lock group works with MPE preview tab
  • Switch between multiple Markdown files and verify the preview updates without closing/reopening (panel size preserved)
  • Switch from Markdown to non-Markdown and confirm preview closes
  • Switch back to Markdown and confirm preview reopens

🤖 Generated with Claude Code

m-hesse and others added 6 commits February 16, 2026 22:23
Introduces a new configuration setting 'previewCommand' that allows
users to use third-party preview extensions like Markdown Preview
Enhanced instead of the hardcoded VS Code default preview.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
openPreview only opens in the same column as a background tab.
The correct MPE command for side preview is openPreviewToTheSide.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
isMarkdownPreviewTab now also matches the 'markdown-preview-enhanced'
viewType when the custom preview command targets MPE, so the lock
group logic works with third-party previews.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a 'previewViewType' setting so the tab detection works with any
third-party preview extension, not just MPE.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When a preview tab already exists, just execute the preview command
again to update it in place instead of closing and reopening. This
preserves the user's panel sizing. The close-on-non-markdown behavior
is unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant