mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #8213 from semberal/codemirror-get-set-value
Add getValue/setValue to CodeMirror.Editor
This commit is contained in:
@@ -46,3 +46,7 @@ var annotation: CodeMirror.Annotation = {
|
||||
message: "test",
|
||||
severity: "warning"
|
||||
};
|
||||
|
||||
myCodeMirror.getValue();
|
||||
myCodeMirror.getValue("foo")
|
||||
myCodeMirror.setValue("bar");
|
||||
|
||||
Vendored
+4
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user