Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ace: Opening search/replace box programmatically

I'm trying to integrate Ace editor to my site. I know that it has keyboard shortcuts for opening the search and replace popups. Is there a way to open them programatically?

I noticed that editor.searchBox is undefined from the start but it is set when I hit cmd+F. I tried to look at ace/ext-searchbox.js but I can't find any method calls to try.

like image 214
pg-robban Avatar asked Mar 14 '14 12:03

pg-robban


1 Answers

See implementation of find command in default_commands.js.

config.loadModule("ace/ext/searchbox", function(m) {m.Search(editor)});

or you can use editor.execCommand("find")

like image 136
a user Avatar answered Oct 14 '22 02:10

a user