zed icon indicating copy to clipboard operation
zed copied to clipboard

Focus editor component under cursor instead of last active component

Open warriorGod opened this issue 2 years ago • 2 comments
trafficstars

Check for existing issues

  • [X] Completed

Describe the feature

Please propagate the initial click that brings focus to the editor so that the clicked element inside the editor gets focus. Tried vscode, it focuses on click. Also in chrome browser, clicking on a different tab will switch to it immediately.

If applicable, add mockups / screenshots to help present your vision of the feature

Problem:

Since switching from vs code to zed I have been sometimes typing into the wrong panel in the zed editor. It happens when you want to swith to Zed from another application by clicking (e.g. I click on the terminal panel), but Zed does not switch focus to it, opting to keep the focus the same as when you left the editor.

Current process:

  1. Zed main panel active
  2. switch to another application, keeping Zed visible
  3. click on Zed terminal panel
  4. start typing -> source code in the main panel is being changed (or whichever panel was focused when leaving zed)

Changed flow:

  1. Zed main panel active
  2. swith to another application, keeping Zed visible
  3. click on Zed terminal panel
  4. (CHANGE) start typing -> terminal has become focused as the user clicked on it. User is successfully typing commands in the terminal.

warriorGod avatar Nov 20 '23 12:11 warriorGod

Thanks for the report @warriorGod - that sees like a good quality-of-life improvement for sure.

JosephTLyons avatar Nov 20 '23 15:11 JosephTLyons

Extending the thought a little: when using a Linux desktop I always used focus-follows-mouse. iTerm2 on the Mac supports it, and it's a huge quality of life improvement. I'd love to see Zed support focussing the pane under the mouse cursor without a click.

simoncocking avatar Feb 21 '24 07:02 simoncocking