Monaco-editor: is there a method or api to control search/replace widget show or hide ?

Created on 9 Apr 2018  路  2Comments  路  Source: microsoft/monaco-editor


monaco-editor version: 0.10.1
Browser: chrome 65.0.3325.181
OS: Windows 7
Steps or JS usage snippet reproducing the issue:

image
I want to hide this widget after user save there content ,is there a method or api to control search/replace widget show or hide ?

Most helpful comment

You could execute a command, e.g. editor.trigger('closeFindWidget') or reach into the find controller and close it e.g. editor.getContribution('editor.contrib.findController').closeFindWidget()

ref:

https://github.com/Microsoft/vscode/blob/f2edfdc20b43602df8bbb155c988f50c0cd5ba5a/src/vs/editor/contrib/find/findController.ts#L196
https://github.com/Microsoft/vscode/blob/f2edfdc20b43602df8bbb155c988f50c0cd5ba5a/src/vs/editor/contrib/find/findController.ts#L708

All 2 comments

You could execute a command, e.g. editor.trigger('closeFindWidget') or reach into the find controller and close it e.g. editor.getContribution('editor.contrib.findController').closeFindWidget()

ref:

https://github.com/Microsoft/vscode/blob/f2edfdc20b43602df8bbb155c988f50c0cd5ba5a/src/vs/editor/contrib/find/findController.ts#L196
https://github.com/Microsoft/vscode/blob/f2edfdc20b43602df8bbb155c988f50c0cd5ba5a/src/vs/editor/contrib/find/findController.ts#L708

thanks,I use editor.trigger('keyboard','closeFindWidget') close it

Was this page helpful?
0 / 5 - 0 ratings