Add getValue/setValue to CodeMirror.Editor

This commit is contained in:
Lukas Sembera
2016-02-23 00:05:24 +01:00
parent bd269cad4c
commit ec01eef9f1
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -46,3 +46,7 @@ var annotation: CodeMirror.Annotation = {
message: "test",
severity: "warning"
};
myCodeMirror.getValue();
myCodeMirror.getValue("foo")
myCodeMirror.setValue("bar");
+4
View File
@@ -145,7 +145,11 @@ declare module CodeMirror {
/** Attach a new document to the editor. Returns the old document, which is now no longer associated with an editor. */
swapDoc(doc: CodeMirror.Doc): CodeMirror.Doc;
/** Get the content of the current editor document. You can pass it an optional argument to specify the string to be used to separate lines (defaults to "\n"). */
getValue(seperator?: string): string;
/** Set the content of the current editor document. */
setValue(content: string): void;
/** Sets the gutter marker for the given gutter (identified by its CSS class, see the gutters option) to the given value.
Value can be either null, to clear the marker, or a DOM element, to set it. The DOM element will be shown in the specified gutter next to the specified line. */