* Sets the current document to `val`. * @param {String} val The new value to set for the document * @param {Number} [cursorPos] Where to set the new value. `undefined` or 0 is selectAll, -1 is at the document start, and 1 is at the end * * @returns {String} The current document v
(val, cursorPos)
| 383 | * @related Document.setValue |
| 384 | **/ |
| 385 | setValue(val, cursorPos) { |
| 386 | this.session.doc.setValue(val); |
| 387 | |
| 388 | if (!cursorPos) |
| 389 | this.selectAll(); |
| 390 | else if (cursorPos == 1) |
| 391 | this.navigateFileEnd(); |
| 392 | else if (cursorPos == -1) |
| 393 | this.navigateFileStart(); |
| 394 | |
| 395 | return val; |
| 396 | } |
| 397 | |
| 398 | /** |
| 399 | * Returns the current session's content. |
no test coverage detected