Skip to content

Cmd+F doesn't work in the markdown preview (only in the editor) #71

Description

@adamatan

What

Cmd+F opens a search panel when focus is in the code editor, but does nothing when focus is in the markdown preview pane.

The editor's Cmd+F comes from CodeMirror's searchKeymap and search({ top: true }) (EditorPane.tsx:232-233, @codemirror/search), which only binds Mod-f while a CodeMirror EditorView has focus. The preview (MarkdownPreview.tsx) is a plain React-rendered <div> with no search state, highlight logic, or keydown listener, so there's nothing for Cmd+F to hit there. It's not intercepted or overridden, it's simply never wired up in that context.

Why it matters

Long rendered markdown (READMEs, docs, changelogs) is exactly where you want in-page find. Right now the only workaround is switching to the raw editor view to search, then switching back to read the rendered result.

Shape of the fix

A find-in-preview affordance scoped to the preview pane (search input + highlight/scroll-to-match), bound to Cmd+F when focus is inside the preview, similar to how VS Code's markdown preview or a browser's in-page find works.

Notes

I'll pick this up in a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions