Closed rgbkrk closed 8 years ago
Nope. You'll have to code that up yourself.
I'm happy coding it up, I'm mostly unsure about how to access search across each instance. I suppose I need to look at this as if it's a new addon, following on from codemirror/addon/search/search
?
(The discussion was continued here: https://stackoverflow.com/questions/39812210/how-can-i-search-across-multiple-codemirror-instances)
Are there hooks that would allow me to enable search/replace across multiple CodeMirror instances on a single page?
Let's say I have the following simple page with two CodeMirror instances:
and that I've included
codemirror/addon/search/search
codemirror/addon/search/searchcursor
codemirror/addon/dialog/dialog
Each CodeMirror instance now has their own search handler when focused on the editor (triggered via ctrl/cmd-f). How could I implement search/replace that works across multiple CodeMirror instances?
There's at least a way to execute a
find
on each editor:editor.execCommand
. I'm not seeing a way to pass through to it, or to query about what results are available.CodePen with example code and imports
StackOverflow issue with (roughly) the same post
Issue on nteract