Skip to content

feat: auto-focus editor on open and re-reveal#154

Open
LeonardoRick wants to merge 1 commit into
zaaack:masterfrom
LeonardoRick:feat/auto-focus-editor
Open

feat: auto-focus editor on open and re-reveal#154
LeonardoRick wants to merge 1 commit into
zaaack:masterfrom
LeonardoRick:feat/auto-focus-editor

Conversation

@LeonardoRick
Copy link
Copy Markdown

Summary

Currently when the markdown editor opens, the cursor doesn't appear in the editable area — users have to click inside to start typing.

This PR adds automatic focus in two scenarios:

  1. First open: calls vditor.focus() in the Vditor after callback so the cursor appears immediately when the editor initializes
  2. Re-reveal: when createOrShow is called on an already-open panel (e.g. via command palette), sends a focus message to the webview so the cursor reappears without requiring a click

Changes

  • media-src/src/main.ts: added vditor.focus() in the after() callback and a focus message handler
  • src/extension.ts: sends { command: 'focus' } to the webview after reveal()

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