commit
b1bb0b9ccc
22 changed files with 361 additions and 221 deletions
|
|
@ -235,6 +235,35 @@ var Editor = function(renderer, session) {
|
|||
return this.session;
|
||||
};
|
||||
|
||||
/** related to: Document.setValue
|
||||
* Editor.setValue(val [,dontSelect]) -> String
|
||||
* - val (String): The new value to set for the document
|
||||
* - cursorPos (number): 0: selectAll, -1 document start, 1 end
|
||||
*
|
||||
* Sets the current document to `val`.
|
||||
**/
|
||||
this.setValue = function(val, cursorPos) {
|
||||
this.session.doc.setValue(val);
|
||||
|
||||
if (!cursorPos)
|
||||
this.selectAll();
|
||||
else if (cursorPos == 1)
|
||||
this.navigateFileEnd();
|
||||
else if (cursorPos == -1)
|
||||
this.navigateFileStart();
|
||||
|
||||
return val;
|
||||
};
|
||||
|
||||
/** related to: EditSession.getValue
|
||||
* Editor.getValue() -> String
|
||||
*
|
||||
* Returns the current session's content.
|
||||
**/
|
||||
this.getValue = function() {
|
||||
return this.session.getValue();
|
||||
};
|
||||
|
||||
/**
|
||||
* Editor.getSelection() -> String
|
||||
*
|
||||
|
|
@ -249,8 +278,8 @@ var Editor = function(renderer, session) {
|
|||
*
|
||||
* {:VirtualRenderer.onResize}
|
||||
**/
|
||||
this.resize = function() {
|
||||
this.renderer.onResize();
|
||||
this.resize = function(force) {
|
||||
this.renderer.onResize(force);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -541,7 +570,7 @@ var Editor = function(renderer, session) {
|
|||
* Emitted when a breakpoint changes.
|
||||
**/
|
||||
this.onChangeBreakpoint = function() {
|
||||
this.renderer.setBreakpoints(this.session.getBreakpoints());
|
||||
this.renderer.updateBreakpoints();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue