Codemirror: Getting an already built instance

Created on 1 Apr 2013  路  3Comments  路  Source: codemirror/CodeMirror

I can't find any mention in the documentation on how to obtain a reference to a CodeMirror instance after the fact (i,e, created in an in closure). I'm writing some bookmarklets at the moment and can't find any way to hook into a page's codemirror instance. Is there a CodeMirror.getInstances() or CodeMirror.getFromTextArea() that can be used to obtain a reference for further work?

Most helpful comment

really important to write a small example of how to get instance of Codemirror from textArea

All 3 comments

The constructor will set a CodeMirror property on the wrapping DOM node it creates which refers to the editor instance.

ah, useful! This might need a small section in the user manual near the fromTextArea etc. functions.

really important to write a small example of how to get instance of Codemirror from textArea

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alangdm picture alangdm  路  3Comments

hameddhib-dydu picture hameddhib-dydu  路  5Comments

alecbz picture alecbz  路  3Comments

marvindanig picture marvindanig  路  5Comments

KnightYoshi picture KnightYoshi  路  6Comments