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

Open search panel programmatically #532

Closed
owennicol opened this issue Aug 6, 2017 · 5 comments
Closed

Open search panel programmatically #532

owennicol opened this issue Aug 6, 2017 · 5 comments

Comments

@owennicol
Copy link

When you do cmd+f in the Monaco Editor, you get the find/search box appear.

Is there a way to have this open when the editor loads, with pre-populated text?

monaco-editor version: 0.9.0
Browser: chrome
OS: macOS
Steps or JS usage snippet reproducing the issue:

@rebornix
Copy link
Member

rebornix commented Aug 9, 2017

You can run editor.getAction('actions.find').run().

@cederfjard
Copy link

Is it at all possible to prepopulate the search box with arbitrary strings, like @owennicol asks? The only thing I've managed to do so far with the function you mentioned, @rebornix, is to search for the text that is currently selected.

@stanislavgeorgiev
Copy link

@owennicol I already added an answer to your question on SO:
https://stackoverflow.com/a/51291297/596082

@ijse
Copy link

ijse commented Jul 18, 2018

how to close the search panel programmatically?

@fi3ework
Copy link

fi3ework commented Aug 20, 2019

@ijse I found the close event ID is closeFindWidget in this useful snippets. #823 (comment)

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants