cleanup
This commit is contained in:
parent
504faad85d
commit
bf2015bf7e
1 changed files with 6 additions and 13 deletions
|
|
@ -44,15 +44,13 @@ var SearchHighlight = require("./search_highlight").SearchHighlight;
|
||||||
var config = require("./config");
|
var config = require("./config");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state.
|
* Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state.
|
||||||
*
|
*
|
||||||
* `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s.
|
* `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s.
|
||||||
* @class EditSession
|
* @class EditSession
|
||||||
**/
|
**/
|
||||||
|
|
||||||
// events
|
//{ events
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Emitted when the document changes.
|
* Emitted when the document changes.
|
||||||
|
|
@ -132,7 +130,7 @@ var config = require("./config");
|
||||||
*
|
*
|
||||||
* @param {Number} scrollLeft The new scroll left value
|
* @param {Number} scrollLeft The new scroll left value
|
||||||
**/
|
**/
|
||||||
|
//}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -153,11 +151,7 @@ var EditSession = function(text, mode) {
|
||||||
|
|
||||||
this.$foldData = [];
|
this.$foldData = [];
|
||||||
this.$foldData.toString = function() {
|
this.$foldData.toString = function() {
|
||||||
var str = "";
|
return this.join("\n");
|
||||||
this.forEach(function(foldLine) {
|
|
||||||
str += "\n" + foldLine.toString();
|
|
||||||
});
|
|
||||||
return str;
|
|
||||||
}
|
}
|
||||||
this.on("changeFold", this.onChangeFold.bind(this));
|
this.on("changeFold", this.onChangeFold.bind(this));
|
||||||
this.$onChange = this.onChange.bind(this);
|
this.$onChange = this.onChange.bind(this);
|
||||||
|
|
@ -958,7 +952,6 @@ var EditSession = function(text, mode) {
|
||||||
this.$worker = null;
|
this.$worker = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
this.$startWorker = function() {
|
this.$startWorker = function() {
|
||||||
if (typeof Worker !== "undefined" && !require.noWorker) {
|
if (typeof Worker !== "undefined" && !require.noWorker) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -1210,7 +1203,7 @@ var EditSession = function(text, mode) {
|
||||||
this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) {
|
this.$getUndoSelection = function(deltas, isUndo, lastUndoRange) {
|
||||||
function isInsert(delta) {
|
function isInsert(delta) {
|
||||||
var insert =
|
var insert =
|
||||||
delta.action == "insertText" || delta.action == "insertLines";
|
delta.action === "insertText" || delta.action === "insertLines";
|
||||||
return isUndo ? !insert : insert;
|
return isUndo ? !insert : insert;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2381,9 +2374,9 @@ config.defineOptions(EditSession.prototype, "session", {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
this.setUseWrapMode(false);
|
this.setUseWrapMode(false);
|
||||||
} else {
|
} else {
|
||||||
var col = typeof value == "number" && value;
|
var col = typeof value == "number" ? value : null;
|
||||||
this.setUseWrapMode(true);
|
this.setUseWrapMode(true);
|
||||||
this.setWrapLimitRange(value, value);
|
this.setWrapLimitRange(col, col);
|
||||||
}
|
}
|
||||||
this.$wrap = value;
|
this.$wrap = value;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue