Skip to content

editor.openFileInVSCode always fails: command palette unfocuses active editor #56

@Cheezeiii365

Description

@Cheezeiii365

Bug

The editor.openFileInVSCode command always fails with "No active editor" when invoked from the command palette.

Root Cause

Opening the command palette moves focus away from the editor pane, which causes getActiveEditor() to return null. By the time the command handler runs, there is no active editor to read the file path and cursor position from.

Expected Behavior

The command should remember which editor was focused before the command palette opened, and use that context when executing.

Steps to Reproduce

  1. Open a file in the editor
  2. Open the command palette (Cmd+Shift+P)
  3. Run "Open Active File in VS Code"
  4. Toast appears: "No active editor"

Suggested Fix

Track the "last focused editor" separately from the currently focused one, so commands invoked via the palette can reference the editor that was active immediately before the palette opened.

🤖 Generated with Claude Code

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