Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vim: Provide way to move focus into hover popups #7284

Open
1 task done
NukaCody opened this issue Feb 2, 2024 · 4 comments
Open
1 task done

Vim: Provide way to move focus into hover popups #7284

NukaCody opened this issue Feb 2, 2024 · 4 comments
Labels
enhancement [core label] popovers Feedback for tooltips, syntax hints, info popups, toasts, etc vim

Comments

@NukaCody
Copy link
Contributor

NukaCody commented Feb 2, 2024

Check for existing issues

  • Completed

Describe the feature

Allow ghh (double h) to move the vim cursor into the pop up menu displaying documentation or errors, allowing you to copy examples, error messages, etc. Then press q to close the pop up message.

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

No response

@NukaCody NukaCody added admin read Pending admin review enhancement [core label] triage Maintainer needs to classify the issue labels Feb 2, 2024
@NukaCody
Copy link
Contributor Author

NukaCody commented Feb 2, 2024

I'd love to give this a try over the weekend if I could get some high level direction on how to achieve this (or a similar commit)

@JosephTLyons JosephTLyons added vim popovers Feedback for tooltips, syntax hints, info popups, toasts, etc and removed triage Maintainer needs to classify the issue admin read Pending admin review labels Feb 2, 2024
@JosephTLyons
Copy link
Collaborator

cc @ConradIrwin for some Vim examples

@NukaCody
Copy link
Contributor Author

NukaCody commented Feb 3, 2024

Doing some research into this, tell me where I'm wrong:

  • Vim delegates to Editor or other crates for functionality
  • Editor has popups here
  • Popups render a "div" by delegating to gpui here

The main issue is that this div does not have any interactivity to the same level of a editor itself or at least an "editor-lite". Ideally there'd be an editor command like "FocusPopover" that would move the cursor into the popover and subsequent q to move to the previous focus (I think that's how it works).

So I think it'd have to be:

  • Implement interactivity in popovers first (As of now you can't highlight text even with a mouse)
    • This one is probably the trickiest and where I'm struggling with where to start as the popover looks to be a readonly static render of data queried from the LSP, not like a "editor lite"
  • Implement a "FocusPopover" command or maybe "TogglePopoverFocus"?
  • Implement a Vim binding that would call this command

@ConradIrwin
Copy link
Member

@NukaCody youre exactly right. I know @mikayla-maki had some ideas for making text in gpui selectable, but I don’t think that’s happened yet.

probably the easiest path forward would be an action to either copy the text in the popup, or open it in a new buffer/split.

@ConradIrwin ConradIrwin changed the title Vim: ghh Moves the vim curser into popup menu Vim: Provide way to move focus into hover popups Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement [core label] popovers Feedback for tooltips, syntax hints, info popups, toasts, etc vim
Projects
None yet
Development

No branches or pull requests

3 participants