Skip to content

CTRL+F save the last search #3743

Answered by alexdima
batata004 asked this question in Q&A
Discussion options

You must be logged in to vote

@batata004 We don't have that in the API of the editor, but this being JS you could try something like the following (paste at https://microsoft.github.io/monaco-editor/playground.html and Run):

const editor = monaco.editor.create(document.getElementById("container"), {
	value: "function hello() {\n\talert('Hello world!');\n}",
	language: "javascript"
});
editor.getContribution('editor.contrib.findController')._state.onFindReplaceStateChange((e) => {
    // console.log(e);
    if (e.isRevealed) {
        console.log(`find replace is now visible`);
    }
})

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by hediet
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
feature-request Request for new features or functionality
2 participants
Converted from issue

This discussion was converted from issue #2397 on March 08, 2023 10:42.