MCPcopy
hub / github.com/ajaxorg/ace / insert

Method insert

src/document.js:235–241  ·  view source on GitHub ↗

* Inserts a block of `text` at the indicated `position`. * @param {Point} position The position to start inserting at; it's an object that looks like `{ row: row, column: column}` * @param {String} text A chunk of text to insert * @returns {Point} The position ({row, column}) of the l

(position, text)

Source from the content-addressed store, hash-verified

233
234 **/
235 insert(position, text) {
236 // Only detect new lines if the document has no line break yet.
237 if (this.getLength() <= 1)
238 this.$detectNewLine(text);
239
240 return this.insertMergedLines(position, this.$split(text));
241 }
242
243 /**
244 * Inserts `text` into the `position` at the current row. This method also triggers the `"change"` event.

Callers 3

constructorMethod · 0.95
setValueMethod · 0.95
replaceMethod · 0.95

Calls 4

getLengthMethod · 0.95
$detectNewLineMethod · 0.95
insertMergedLinesMethod · 0.95
$splitMethod · 0.95

Tested by

no test coverage detected