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

Restore text selection after closing modal #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

joonakeskitalo
Copy link

Description:

  • Saves and restores user's text selection on modal close and open
  • 25ms delay is added so that commands which rely on the selection work reliably. Feels hacky, but couldn't come up with better solution.

Usecase is that the user has some text selected and the palette is used to run some commands relating to that selection.

- Saves and restores user's text selection on modal close and open
- 25ms delay added for commands that use the selection to work reliably
@rouilj
Copy link
Contributor

rouilj commented Oct 6, 2023

Thanks for exploring this use case. I wanted to have a reformat text option from the command palette.

With your patch, how does the palette command access the selected text?

Do you have an example action that uses this?

Also given #52, how are you triggering commandPal so the selection isn't lost?

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.

2 participants