tabs to spaces
This commit is contained in:
parent
43c4a8fc35
commit
ac364fe0c5
97 changed files with 577 additions and 577 deletions
|
|
@ -98,4 +98,4 @@ exports.edit = function(el) {
|
|||
return editor;
|
||||
};
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -181,4 +181,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,4 +190,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,4 +98,4 @@ exports.multiEditCommands = {"singleSelection": "esc"};
|
|||
var HashHandler = require("../keyboard/hash_handler").HashHandler;
|
||||
exports.keyboardHandler = new HashHandler(exports.multiEditCommands);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -125,4 +125,4 @@ function deHyphenate(str) {
|
|||
return str.replace(/-(.)/g, function(m, m1) { return m1.toUpperCase(); });
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -78,11 +78,11 @@ var Document = function(text) {
|
|||
oop.implement(this, EventEmitter);
|
||||
|
||||
/**
|
||||
* Document.setValue(text) -> Void
|
||||
* - text (String): The text to use
|
||||
*
|
||||
* Document.setValue(text) -> Void
|
||||
* - text (String): The text to use
|
||||
*
|
||||
* Replaces all the lines in the current `Document` with the value of `text`.
|
||||
**/
|
||||
**/
|
||||
this.setValue = function(text) {
|
||||
var len = this.getLength();
|
||||
this.remove(new Range(0, 0, len, this.getLine(len-1).length));
|
||||
|
|
@ -90,21 +90,21 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.getValue() -> String
|
||||
*
|
||||
* Returns all the lines in the document as a single string, split by the new line character.
|
||||
**/
|
||||
* Document.getValue() -> String
|
||||
*
|
||||
* Returns all the lines in the document as a single string, split by the new line character.
|
||||
**/
|
||||
this.getValue = function() {
|
||||
return this.getAllLines().join(this.getNewLineCharacter());
|
||||
};
|
||||
|
||||
/**
|
||||
* Document.createAnchor(row, column) -> Anchor
|
||||
* - row (Number): The row number to use
|
||||
* Document.createAnchor(row, column) -> Anchor
|
||||
* - row (Number): The row number to use
|
||||
* - column (Number): The column number to use
|
||||
*
|
||||
* Creates a new `Anchor` to define a floating point in the document.
|
||||
**/
|
||||
* Creates a new `Anchor` to define a floating point in the document.
|
||||
**/
|
||||
this.createAnchor = function(row, column) {
|
||||
return new Anchor(this, row, column);
|
||||
};
|
||||
|
|
@ -131,10 +131,10 @@ var Document = function(text) {
|
|||
|
||||
|
||||
/** internal, hide
|
||||
* Document.$detectNewLine(text) -> Void
|
||||
*
|
||||
*
|
||||
**/
|
||||
* Document.$detectNewLine(text) -> Void
|
||||
*
|
||||
*
|
||||
**/
|
||||
this.$detectNewLine = function(text) {
|
||||
var match = text.match(/^.*?(\r\n|\r|\n)/m);
|
||||
if (match) {
|
||||
|
|
@ -194,63 +194,63 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.isNewLine(text) -> Boolean
|
||||
* - text (String): The text to check
|
||||
* Document.isNewLine(text) -> Boolean
|
||||
* - text (String): The text to check
|
||||
*
|
||||
* Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`).
|
||||
* Returns `true` if `text` is a newline character (either `\r\n`, `\r`, or `\n`).
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.isNewLine = function(text) {
|
||||
return (text == "\r\n" || text == "\r" || text == "\n");
|
||||
};
|
||||
|
||||
/**
|
||||
* Document.getLine(row) -> String
|
||||
* - row (Number): The row index to retrieve
|
||||
*
|
||||
* Document.getLine(row) -> String
|
||||
* - row (Number): The row index to retrieve
|
||||
*
|
||||
* Returns a verbatim copy of the given line as it is in the document
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.getLine = function(row) {
|
||||
return this.$lines[row] || "";
|
||||
};
|
||||
|
||||
/**
|
||||
* Document.getLines(firstRow, lastRow) -> [String]
|
||||
* - firstRow (Number): The first row index to retrieve
|
||||
* Document.getLines(firstRow, lastRow) -> [String]
|
||||
* - firstRow (Number): The first row index to retrieve
|
||||
* - lastRow (Number): The final row index to retrieve
|
||||
*
|
||||
*
|
||||
* Returns an array of strings of the rows between `firstRow` and `lastRow`. This function is inclusive of `lastRow`.
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.getLines = function(firstRow, lastRow) {
|
||||
return this.$lines.slice(firstRow, lastRow + 1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Document.getAllLines() -> [String]
|
||||
*
|
||||
* Returns all lines in the document as string array. Warning: The caller should not modify this array!
|
||||
**/
|
||||
* Document.getAllLines() -> [String]
|
||||
*
|
||||
* Returns all lines in the document as string array. Warning: The caller should not modify this array!
|
||||
**/
|
||||
this.getAllLines = function() {
|
||||
return this.getLines(0, this.getLength());
|
||||
};
|
||||
|
||||
/**
|
||||
* Document.getLength() -> Number
|
||||
*
|
||||
* Returns the number of rows in the document.
|
||||
**/
|
||||
* Document.getLength() -> Number
|
||||
*
|
||||
* Returns the number of rows in the document.
|
||||
**/
|
||||
this.getLength = function() {
|
||||
return this.$lines.length;
|
||||
};
|
||||
|
||||
/**
|
||||
* Document.getTextRange(range) -> String
|
||||
* - range (Range): The range to work with
|
||||
*
|
||||
* Document.getTextRange(range) -> String
|
||||
* - range (Range): The range to work with
|
||||
*
|
||||
* [Given a range within the document, this function returns all the text within that range as a single string.]{: #Document.getTextRange.desc}
|
||||
**/
|
||||
**/
|
||||
this.getTextRange = function(range) {
|
||||
if (range.start.row == range.end.row) {
|
||||
return this.$lines[range.start.row].substring(range.start.column,
|
||||
|
|
@ -265,10 +265,10 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/** internal, hide
|
||||
* Document.$clipPosition(position) -> Number
|
||||
*
|
||||
* Document.$clipPosition(position) -> Number
|
||||
*
|
||||
**/
|
||||
*
|
||||
**/
|
||||
this.$clipPosition = function(position) {
|
||||
var length = this.getLength();
|
||||
if (position.row >= length) {
|
||||
|
|
@ -279,14 +279,14 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.insert(position, text) -> Number
|
||||
* - position (Number): The position to start inserting at
|
||||
* Document.insert(position, text) -> Number
|
||||
* - position (Number): The position to start inserting at
|
||||
* - text (String): A chunk of text to insert
|
||||
* + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`.
|
||||
* + (Number): The position of the last line of `text`. If the length of `text` is 0, this function simply returns `position`.
|
||||
* Inserts a block of `text` and the indicated `position`.
|
||||
*
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.insert = function(position, text) {
|
||||
if (!text || text.length === 0)
|
||||
return position;
|
||||
|
|
@ -311,10 +311,10 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.insertLines(row, lines) -> Object
|
||||
* - row (Number): The index of the row to insert at
|
||||
* Document.insertLines(row, lines) -> Object
|
||||
* - row (Number): The index of the row to insert at
|
||||
* - lines (Array): An array of strings
|
||||
* + (Object): Returns an object containing the final row and column, like this:<br/>
|
||||
* + (Object): Returns an object containing the final row and column, like this:<br/>
|
||||
* ```{row: endRow, column: 0}```<br/>
|
||||
* If `lines` is empty, this function returns an object containing the current row, and column, like this:<br/>
|
||||
* ```{row: row, column: 0}```
|
||||
|
|
@ -322,7 +322,7 @@ var Document = function(text) {
|
|||
* Inserts the elements in `lines` into the document, starting at the row index given by `row`. This method also triggers the `'change'` event.
|
||||
*
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.insertLines = function(row, lines) {
|
||||
if (lines.length == 0)
|
||||
return {row: row, column: 0};
|
||||
|
|
@ -342,16 +342,16 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.insertNewLine(position) -> Object
|
||||
* - position (String): The position to insert at
|
||||
* + (Object): Returns an object containing the final row and column, like this:<br/>
|
||||
* Document.insertNewLine(position) -> Object
|
||||
* - position (String): The position to insert at
|
||||
* + (Object): Returns an object containing the final row and column, like this:<br/>
|
||||
* ```{row: endRow, column: 0}```
|
||||
*
|
||||
* Inserts a new line into the document at the current row's `position`. This method also triggers the `'change'` event.
|
||||
*
|
||||
*
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.insertNewLine = function(position) {
|
||||
position = this.$clipPosition(position);
|
||||
var line = this.$lines[position.row] || "";
|
||||
|
|
@ -375,7 +375,7 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.insertInLine(position, text) -> Object | Number
|
||||
* Document.insertInLine(position, text) -> Object | Number
|
||||
* - position (Number): The position to insert at
|
||||
* - text (String): A chunk of text
|
||||
* + (Object): Returns an object containing the final row and column, like this:<br/>
|
||||
|
|
@ -386,7 +386,7 @@ var Document = function(text) {
|
|||
*
|
||||
*
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.insertInLine = function(position, text) {
|
||||
if (text.length == 0)
|
||||
return position;
|
||||
|
|
@ -412,14 +412,14 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.remove(range) -> Object
|
||||
* - range (Range): A specified Range to remove
|
||||
* + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`.
|
||||
* Document.remove(range) -> Object
|
||||
* - range (Range): A specified Range to remove
|
||||
* + (Object): Returns the new `start` property of the range, which contains `startRow` and `startColumn`. If `range` is empty, this function returns the unmodified value of `range.start`.
|
||||
*
|
||||
* Removes the `range` from the document.
|
||||
*
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.remove = function(range) {
|
||||
// clip to document
|
||||
range.start = this.$clipPosition(range.start);
|
||||
|
|
@ -453,7 +453,7 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.removeInLine(row, startColumn, endColumn) -> Object
|
||||
* Document.removeInLine(row, startColumn, endColumn) -> Object
|
||||
* - row (Number): The row to remove from
|
||||
* - startColumn (Number): The column to start removing at
|
||||
* - endColumn (Number): The column to stop removing at
|
||||
|
|
@ -483,15 +483,15 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.removeLines(firstRow, lastRow) -> [String]
|
||||
* - firstRow (Number): The first row to be removed
|
||||
* Document.removeLines(firstRow, lastRow) -> [String]
|
||||
* - firstRow (Number): The first row to be removed
|
||||
* - lastRow (Number): The last row to be removed
|
||||
* + ([String]): Returns all the removed lines.
|
||||
*
|
||||
* Removes a range of full lines. This method also triggers the `'change'` event.
|
||||
*
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.removeLines = function(firstRow, lastRow) {
|
||||
var range = new Range(firstRow, 0, lastRow + 1, 0);
|
||||
var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1);
|
||||
|
|
@ -507,12 +507,12 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.removeNewLine(row) -> Void
|
||||
* - row (Number): The row to check
|
||||
*
|
||||
* Document.removeNewLine(row) -> Void
|
||||
* - row (Number): The row to check
|
||||
*
|
||||
* Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event.
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.removeNewLine = function(row) {
|
||||
var firstLine = this.getLine(row);
|
||||
var secondLine = this.getLine(row+1);
|
||||
|
|
@ -531,9 +531,9 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.replace(range, text) -> Object
|
||||
* Document.replace(range, text) -> Object
|
||||
* - range (Range): A specified Range to replace
|
||||
* - text (String): The new text to use as a replacement
|
||||
* - text (String): The new text to use as a replacement
|
||||
* + (Object): Returns an object containing the final row and column, like this:
|
||||
* {row: endRow, column: 0}
|
||||
* If the text and range are empty, this function returns an object containing the current `range.start` value.
|
||||
|
|
@ -541,7 +541,7 @@ var Document = function(text) {
|
|||
*
|
||||
* Replaces a range in the document with the new `text`.
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.replace = function(range, text) {
|
||||
if (text.length == 0 && range.isEmpty())
|
||||
return range.start;
|
||||
|
|
@ -563,10 +563,10 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.applyDeltas(deltas) -> Void
|
||||
*
|
||||
* Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
|
||||
**/
|
||||
* Document.applyDeltas(deltas) -> Void
|
||||
*
|
||||
* Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
|
||||
**/
|
||||
this.applyDeltas = function(deltas) {
|
||||
for (var i=0; i<deltas.length; i++) {
|
||||
var delta = deltas[i];
|
||||
|
|
@ -584,10 +584,10 @@ var Document = function(text) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Document.revertDeltas(deltas) -> Void
|
||||
*
|
||||
* Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
|
||||
**/
|
||||
* Document.revertDeltas(deltas) -> Void
|
||||
*
|
||||
* Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
|
||||
**/
|
||||
this.revertDeltas = function(deltas) {
|
||||
for (var i=deltas.length-1; i>=0; i--) {
|
||||
var delta = deltas[i];
|
||||
|
|
|
|||
|
|
@ -311,4 +311,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -113,4 +113,4 @@ var Fold = exports.Fold = function(range, placeholder) {
|
|||
|
||||
}).call(Fold.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -273,4 +273,4 @@ function FoldLine(foldData, folds) {
|
|||
}).call(FoldLine.prototype);
|
||||
|
||||
exports.FoldLine = FoldLine;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -982,4 +982,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -475,17 +475,18 @@ var Editor = function(renderer, session) {
|
|||
session.$highlightLineMarker = null;
|
||||
|
||||
if (this.$highlightActiveLine) {
|
||||
var cursor = this.getCursorPosition(),
|
||||
foldLine = this.session.getFoldLine(cursor.row);
|
||||
var cursor = this.getCursorPosition();
|
||||
var foldLine = this.session.getFoldLine(cursor.row);
|
||||
|
||||
if ((this.getSelectionStyle() != "line" || !this.selection.isMultiLine())) {
|
||||
var range;
|
||||
if (foldLine) {
|
||||
range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0);
|
||||
} else {
|
||||
range = new Range(cursor.row, 0, cursor.row+1, 0);
|
||||
var range;
|
||||
if (foldLine) {
|
||||
range = new Range(foldLine.start.row, 0, foldLine.end.row + 1, 0);
|
||||
} else {
|
||||
range = new Range(cursor.row, 0, cursor.row+1, 0);
|
||||
}
|
||||
session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background");
|
||||
}
|
||||
session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background");
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -192,4 +192,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,4 +212,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -168,4 +168,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ module.exports = {
|
|||
editor.onTextInput("\n");
|
||||
assert.equal(["", "{"].join("\n"), session.toString());
|
||||
},
|
||||
|
||||
|
||||
"test: outdent block" : function() {
|
||||
var session = new EditSession([" a12345", " b12345", " c12345"].join("\n"));
|
||||
var editor = new Editor(new MockRenderer(), session);
|
||||
|
|
@ -559,4 +559,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,4 +95,4 @@ exports.render = function(input, mode, theme, lineStart) {
|
|||
};
|
||||
};
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -78,4 +78,4 @@ function hello (a, b, c) {\n\
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,4 +210,4 @@ var Marker = function(parentEl) {
|
|||
|
||||
exports.Marker = Marker;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -103,4 +103,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1056,4 +1056,4 @@ var prepareString = "a"[0] != "a",
|
|||
}
|
||||
return Object(o);
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -118,4 +118,4 @@ EventEmitter.removeAllListeners = function(eventName) {
|
|||
|
||||
exports.EventEmitter = EventEmitter;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -69,4 +69,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ define(function(require, exports, module) {
|
|||
require("./regexp");
|
||||
require("./es5-shim");
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -126,4 +126,4 @@ exports.keyCodeToString = function(keyCode) {
|
|||
return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase();
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -59,4 +59,4 @@ exports.loadScript = function(path, callback) {
|
|||
s.onload = callback;
|
||||
};
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -95,4 +95,4 @@ var Behaviour = function() {
|
|||
}).call(Behaviour.prototype);
|
||||
|
||||
exports.Behaviour = Behaviour;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -222,4 +222,4 @@ var CstyleBehaviour = function () {
|
|||
oop.inherits(CstyleBehaviour, Behaviour);
|
||||
|
||||
exports.CstyleBehaviour = CstyleBehaviour;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -89,4 +89,4 @@ var XmlBehaviour = function () {
|
|||
oop.inherits(XmlBehaviour, Behaviour);
|
||||
|
||||
exports.XmlBehaviour = XmlBehaviour;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -118,4 +118,4 @@ oop.inherits(Mode, TextMode);
|
|||
|
||||
exports.Mode = Mode;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -60,4 +60,4 @@ define(function(require, exports, module) {
|
|||
exports.parse = function(code) {
|
||||
return parser.parse(lexer.tokenize(code));
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -600,4 +600,4 @@ parse: function parse(input) {
|
|||
module.exports = parser;
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -65,4 +65,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,4 +69,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,4 +89,4 @@ oop.inherits(Worker, Mirror);
|
|||
|
||||
}).call(Worker.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -96,4 +96,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,4 +82,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,4 +63,4 @@ oop.inherits(Worker, Mirror);
|
|||
|
||||
}).call(Worker.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -72,4 +72,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,4 +92,4 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -89,4 +89,4 @@ module.exports = {
|
|||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main)
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
|
|
|
|||
|
|
@ -83,4 +83,4 @@ var FoldMode = exports.FoldMode = function() {
|
|||
|
||||
oop.inherits(FoldMode, MixedFoldMode);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -166,4 +166,4 @@ module.exports = {
|
|||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main)
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
|
|
|
|||
|
|
@ -85,4 +85,4 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -62,4 +62,4 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -99,4 +99,4 @@ module.exports = {
|
|||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main)
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
|
|
|
|||
|
|
@ -259,4 +259,4 @@ oop.inherits(FoldMode, BaseFoldMode);
|
|||
|
||||
}).call(FoldMode.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -114,4 +114,4 @@ module.exports = {
|
|||
});
|
||||
|
||||
if (typeof module !== "undefined" && module === require.main)
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
|
|
|
|||
|
|
@ -90,4 +90,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,4 +71,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -222,4 +222,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -162,4 +162,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,4 +85,4 @@ oop.inherits(JavaScriptWorker, Mirror);
|
|||
|
||||
}).call(JavaScriptWorker.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -96,4 +96,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,4 +97,4 @@ oop.inherits(Mode, TextMode);
|
|||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -343,4 +343,4 @@ define(function(require, exports, module) {
|
|||
return reviver.call(holder, key, value);
|
||||
}({'': result}, '') : result;
|
||||
};
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -100,4 +100,4 @@ oop.inherits(JsonWorker, Mirror);
|
|||
|
||||
}).call(JsonWorker.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -105,4 +105,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ oop.inherits(Mode, TextMode);
|
|||
|
||||
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
|
||||
var tokens = tokenizedLine.tokens;
|
||||
|
||||
|
||||
var chunks = ["function", "then", "do", "repeat"];
|
||||
|
||||
if (state == "start") {
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ var LuaHighlightRules = function() {
|
|||
this.$rules = {
|
||||
"start" :
|
||||
|
||||
|
||||
|
||||
// bracketed comments
|
||||
[{
|
||||
token : "comment", // --[[ comment
|
||||
|
|
@ -132,9 +132,9 @@ var LuaHighlightRules = function() {
|
|||
token : "comment", // --[====+[ comment
|
||||
regex : strPre + '\\-\\-\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]'
|
||||
},
|
||||
|
||||
// multiline bracketed comments
|
||||
{
|
||||
|
||||
// multiline bracketed comments
|
||||
{
|
||||
token : "comment", // --[[ comment
|
||||
regex : strPre + '\\-\\-\\[\\[.*$',
|
||||
merge : true,
|
||||
|
|
@ -184,7 +184,7 @@ var LuaHighlightRules = function() {
|
|||
},
|
||||
|
||||
// bracketed strings
|
||||
{
|
||||
{
|
||||
token : "string", // [[ string
|
||||
regex : strPre + '\\[\\[.*\\]\\]'
|
||||
}, {
|
||||
|
|
@ -203,8 +203,8 @@ var LuaHighlightRules = function() {
|
|||
token : "string", // [====+[ string
|
||||
regex : strPre + '\\[\\={5}\\=*\\[.*\\]\\={5}\\=*\\]'
|
||||
},
|
||||
|
||||
// multiline bracketed strings
|
||||
|
||||
// multiline bracketed strings
|
||||
{
|
||||
token : "string", // [[ string
|
||||
regex : strPre + '\\[\\[.*$',
|
||||
|
|
|
|||
|
|
@ -78,4 +78,4 @@ oop.inherits(Mode, TextMode);
|
|||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -192,4 +192,4 @@ var MarkdownHighlightRules = function() {
|
|||
oop.inherits(MarkdownHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.MarkdownHighlightRules = MarkdownHighlightRules;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -83,4 +83,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,4 +68,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,4 +100,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,4 +79,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,4 +67,4 @@ var Editor = exports.Editor = function() {
|
|||
|
||||
}).call(Editor.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -51,4 +51,4 @@ function GutterHandler(editor) {
|
|||
|
||||
exports.GutterHandler = GutterHandler;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -68,4 +68,4 @@ function FoldHandler(editor) {
|
|||
|
||||
exports.FoldHandler = FoldHandler;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -164,4 +164,4 @@ function onMouseDown(e) {
|
|||
|
||||
exports.onMouseDown = onMouseDown;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ var EditSession = require("./edit_session").EditSession;
|
|||
// extend Editor
|
||||
var Editor = require("./editor").Editor;
|
||||
(function() {
|
||||
|
||||
|
||||
/** extension
|
||||
* Editor.updateSelectionMarkers()
|
||||
*
|
||||
|
|
@ -758,4 +758,4 @@ function addAltCursorListeners(editor){
|
|||
|
||||
exports.MultiSelect = MultiSelect;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ module.exports = {
|
|||
]);
|
||||
editor = new Editor(new MockRenderer(), doc);
|
||||
MultiSelect(editor);
|
||||
var selection = editor.selection;
|
||||
var selection = editor.selection;
|
||||
|
||||
var range1 = new Range(0, 2, 0, 4);
|
||||
editor.selection.fromOrientedRange(range1);
|
||||
|
|
@ -168,4 +168,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -693,4 +693,4 @@ exports.Dict = Dict;
|
|||
exports.WeakMap = _WeakMap;
|
||||
exports.Stack = Stack;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -595,4 +595,4 @@ Tokenizer.prototype = {
|
|||
exports.isIdentifier = isIdentifier;
|
||||
exports.Tokenizer = Tokenizer;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -58,4 +58,4 @@ exports.mozillaMode = true;
|
|||
// Allow experimental paren-free mode?
|
||||
exports.parenFreeMode = false;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2069,4 +2069,4 @@ exports.Parser = Parser;
|
|||
exports.Module = Module;
|
||||
exports.Export = Export;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -161,4 +161,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,4 +167,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,4 +195,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,4 +55,4 @@ define(function (require, exports, module) {
|
|||
};
|
||||
});
|
||||
|
||||
})();
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -417,4 +417,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,10 +87,10 @@ var Selection = function(session) {
|
|||
oop.implement(this, EventEmitter);
|
||||
|
||||
/**
|
||||
* Selection.isEmpty() -> Boolean
|
||||
*
|
||||
* Returns `true` if the selection is empty.
|
||||
**/
|
||||
* Selection.isEmpty() -> Boolean
|
||||
*
|
||||
* Returns `true` if the selection is empty.
|
||||
**/
|
||||
this.isEmpty = function() {
|
||||
return (this.$isEmpty || (
|
||||
this.selectionAnchor.row == this.selectionLead.row &&
|
||||
|
|
@ -99,10 +99,10 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.isMultiLine() -> Boolean
|
||||
*
|
||||
* Returns `true` if the selection is a multi-line.
|
||||
**/
|
||||
* Selection.isMultiLine() -> Boolean
|
||||
*
|
||||
* Returns `true` if the selection is a multi-line.
|
||||
**/
|
||||
this.isMultiLine = function() {
|
||||
if (this.isEmpty()) {
|
||||
return false;
|
||||
|
|
@ -112,7 +112,7 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.getCursor() -> Number
|
||||
* Selection.getCursor() -> Number
|
||||
*
|
||||
* Gets the current position of the cursor.
|
||||
**/
|
||||
|
|
@ -121,12 +121,12 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.setSelectionAnchor(row, column)
|
||||
* - row (Number): The new row
|
||||
* - column (Number): The new column
|
||||
* Selection.setSelectionAnchor(row, column)
|
||||
* - row (Number): The new row
|
||||
* - column (Number): The new column
|
||||
*
|
||||
* Sets the row and column position of the anchor. This function also emits the `'changeSelection'` event.
|
||||
**/
|
||||
**/
|
||||
this.setSelectionAnchor = function(row, column) {
|
||||
this.selectionAnchor.setPosition(row, column);
|
||||
|
||||
|
|
@ -137,11 +137,11 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/** related to: Anchor.getPosition
|
||||
* Selection.getSelectionAnchor() -> Object
|
||||
*
|
||||
* Returns an object containing the `row` and `column` of the calling selection anchor.
|
||||
* Selection.getSelectionAnchor() -> Object
|
||||
*
|
||||
* Returns an object containing the `row` and `column` of the calling selection anchor.
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.getSelectionAnchor = function() {
|
||||
if (this.$isEmpty)
|
||||
return this.getSelectionLead()
|
||||
|
|
@ -150,21 +150,21 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.getSelectionLead() -> Object
|
||||
*
|
||||
* Returns an object containing the `row` and `column` of the calling selection lead.
|
||||
**/
|
||||
* Selection.getSelectionLead() -> Object
|
||||
*
|
||||
* Returns an object containing the `row` and `column` of the calling selection lead.
|
||||
**/
|
||||
this.getSelectionLead = function() {
|
||||
return this.selectionLead.getPosition();
|
||||
};
|
||||
|
||||
/**
|
||||
* Selection.shiftSelection(columns)
|
||||
* - columns (Number): The number of columns to shift by
|
||||
*
|
||||
* Selection.shiftSelection(columns)
|
||||
* - columns (Number): The number of columns to shift by
|
||||
*
|
||||
* Shifts the selection up (or down, if [[Selection.isBackwards `isBackwards()`]] is true) the given number of columns.
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.shiftSelection = function(columns) {
|
||||
if (this.$isEmpty) {
|
||||
this.moveCursorTo(this.selectionLead.row, this.selectionLead.column + columns);
|
||||
|
|
@ -187,10 +187,10 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.isBackwards() -> Boolean
|
||||
*
|
||||
* Returns `true` if the selection is going backwards in the document.
|
||||
**/
|
||||
* Selection.isBackwards() -> Boolean
|
||||
*
|
||||
* Returns `true` if the selection is going backwards in the document.
|
||||
**/
|
||||
this.isBackwards = function() {
|
||||
var anchor = this.selectionAnchor;
|
||||
var lead = this.selectionLead;
|
||||
|
|
@ -198,10 +198,10 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.getRange() -> Range
|
||||
*
|
||||
* [Returns the [[Range `Range`]] for the selected text.]{: #Selection.getRange}
|
||||
**/
|
||||
* Selection.getRange() -> Range
|
||||
*
|
||||
* [Returns the [[Range `Range`]] for the selected text.]{: #Selection.getRange}
|
||||
**/
|
||||
this.getRange = function() {
|
||||
var anchor = this.selectionAnchor;
|
||||
var lead = this.selectionLead;
|
||||
|
|
@ -218,10 +218,10 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.clearSelection()
|
||||
*
|
||||
* [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection}
|
||||
**/
|
||||
* Selection.clearSelection()
|
||||
*
|
||||
* [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection}
|
||||
**/
|
||||
this.clearSelection = function() {
|
||||
if (!this.$isEmpty) {
|
||||
this.$isEmpty = true;
|
||||
|
|
@ -230,10 +230,10 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.selectAll()
|
||||
*
|
||||
* Selects all the text in the document.
|
||||
**/
|
||||
* Selection.selectAll()
|
||||
*
|
||||
* Selects all the text in the document.
|
||||
**/
|
||||
this.selectAll = function() {
|
||||
var lastRow = this.doc.getLength() - 1;
|
||||
this.setSelectionAnchor(lastRow, this.doc.getLine(lastRow).length);
|
||||
|
|
@ -241,13 +241,13 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.setSelectionRange(range, reverse)
|
||||
* - range (Range): The range of text to select
|
||||
* - reverse (Boolean): Indicates if the range should go backwards (`true`) or not
|
||||
* Selection.setSelectionRange(range, reverse)
|
||||
* - range (Range): The range of text to select
|
||||
* - reverse (Boolean): Indicates if the range should go backwards (`true`) or not
|
||||
*
|
||||
* Sets the selection to the provided range.
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.setSelectionRange = function(range, reverse) {
|
||||
if (reverse) {
|
||||
this.setSelectionAnchor(range.end.row, range.end.column);
|
||||
|
|
@ -268,13 +268,13 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.selectTo(row, column)
|
||||
* - row (Number): The row to select to
|
||||
* - column (Number): The column to select to
|
||||
* Selection.selectTo(row, column)
|
||||
* - row (Number): The row to select to
|
||||
* - column (Number): The column to select to
|
||||
*
|
||||
* Moves the selection cursor to the indicated row and column.
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.selectTo = function(row, column) {
|
||||
this.$moveSelection(function() {
|
||||
this.moveCursorTo(row, column);
|
||||
|
|
@ -282,12 +282,12 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.selectToPosition(pos)
|
||||
* - pos (Object): An object containing the row and column
|
||||
*
|
||||
* Selection.selectToPosition(pos)
|
||||
* - pos (Object): An object containing the row and column
|
||||
*
|
||||
* Moves the selection cursor to the row and column indicated by `pos`.
|
||||
*
|
||||
**/
|
||||
**/
|
||||
this.selectToPosition = function(pos) {
|
||||
this.$moveSelection(function() {
|
||||
this.moveCursorToPosition(pos);
|
||||
|
|
@ -295,10 +295,10 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.selectUp()
|
||||
*
|
||||
* Moves the selection up one row.
|
||||
**/
|
||||
* Selection.selectUp()
|
||||
*
|
||||
* Moves the selection up one row.
|
||||
**/
|
||||
this.selectUp = function() {
|
||||
this.$moveSelection(this.moveCursorUp);
|
||||
};
|
||||
|
|
@ -331,10 +331,10 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.selectLineStart()
|
||||
*
|
||||
* Moves the selection to the beginning of the current line.
|
||||
**/
|
||||
* Selection.selectLineStart()
|
||||
*
|
||||
* Moves the selection to the beginning of the current line.
|
||||
**/
|
||||
this.selectLineStart = function() {
|
||||
this.$moveSelection(this.moveCursorLineStart);
|
||||
};
|
||||
|
|
@ -385,10 +385,10 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/** related to: EditSession.getWordRange
|
||||
* Selection.selectWord()
|
||||
*
|
||||
* Moves the selection to highlight the entire word.
|
||||
**/
|
||||
* Selection.selectWord()
|
||||
*
|
||||
* Moves the selection to highlight the entire word.
|
||||
**/
|
||||
this.getWordRange = function(row, column) {
|
||||
if (typeof column == "undefined") {
|
||||
var cursor = row || this.selectionLead;
|
||||
|
|
@ -398,16 +398,15 @@ var Selection = function(session) {
|
|||
return this.session.getWordRange(row, column);
|
||||
};
|
||||
|
||||
>>>>>>> ui/navbar
|
||||
this.selectWord = function() {
|
||||
this.setSelectionRange(this.getWordRange());
|
||||
};
|
||||
|
||||
/** related to: EditSession.getAWordRange
|
||||
* Selection.selectAWord()
|
||||
*
|
||||
* Selects a word, including its right whitespace.
|
||||
**/
|
||||
* Selection.selectAWord()
|
||||
*
|
||||
* Selects a word, including its right whitespace.
|
||||
**/
|
||||
this.selectAWord = function() {
|
||||
var cursor = this.getCursor();
|
||||
var range = this.session.getAWordRange(cursor.row, cursor.column);
|
||||
|
|
@ -441,28 +440,28 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorUp()
|
||||
*
|
||||
* Moves the cursor up one row.
|
||||
**/
|
||||
* Selection.moveCursorUp()
|
||||
*
|
||||
* Moves the cursor up one row.
|
||||
**/
|
||||
this.moveCursorUp = function() {
|
||||
this.moveCursorBy(-1, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorDown()
|
||||
* Selection.moveCursorDown()
|
||||
*
|
||||
* Moves the cursor down one row.
|
||||
**/
|
||||
**/
|
||||
this.moveCursorDown = function() {
|
||||
this.moveCursorBy(1, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorLeft()
|
||||
* Selection.moveCursorLeft()
|
||||
*
|
||||
* Moves the cursor left one column.
|
||||
**/
|
||||
**/
|
||||
this.moveCursorLeft = function() {
|
||||
var cursor = this.selectionLead.getPosition(),
|
||||
fold;
|
||||
|
|
@ -485,7 +484,7 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorRight()
|
||||
* Selection.moveCursorRight()
|
||||
*
|
||||
* Moves the cursor right one column.
|
||||
**/
|
||||
|
|
@ -511,7 +510,7 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorLineStart()
|
||||
* Selection.moveCursorLineStart()
|
||||
*
|
||||
* Moves the cursor to the start of the line.
|
||||
**/
|
||||
|
|
@ -544,7 +543,7 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorLineEnd()
|
||||
* Selection.moveCursorLineEnd()
|
||||
*
|
||||
* Moves the cursor to the end of the line.
|
||||
**/
|
||||
|
|
@ -559,7 +558,7 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorFileEnd()
|
||||
* Selection.moveCursorFileEnd()
|
||||
*
|
||||
* Moves the cursor to the end of the file.
|
||||
**/
|
||||
|
|
@ -570,7 +569,7 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorFileStart()
|
||||
* Selection.moveCursorFileStart()
|
||||
*
|
||||
* Moves the cursor to the start of the file.
|
||||
**/
|
||||
|
|
@ -626,7 +625,7 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorLongWordLeft()
|
||||
* Selection.moveCursorLongWordLeft()
|
||||
*
|
||||
* Moves the cursor to the word on the left.
|
||||
**/
|
||||
|
|
@ -789,23 +788,23 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorToPosition(position)
|
||||
* - position (Object): The position to move to
|
||||
*
|
||||
* Selection.moveCursorToPosition(position)
|
||||
* - position (Object): The position to move to
|
||||
*
|
||||
* Moves the selection to the position indicated by its `row` and `column`.
|
||||
**/
|
||||
**/
|
||||
this.moveCursorToPosition = function(position) {
|
||||
this.moveCursorTo(position.row, position.column);
|
||||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorTo(row, column, keepDesiredColumn)
|
||||
* - row (Number): The row to move to
|
||||
* - column (Number): The column to move to
|
||||
* Selection.moveCursorTo(row, column, keepDesiredColumn)
|
||||
* - row (Number): The row to move to
|
||||
* - column (Number): The column to move to
|
||||
* - keepDesiredColumn (Boolean): [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool}
|
||||
*
|
||||
* Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc}
|
||||
**/
|
||||
**/
|
||||
this.moveCursorTo = function(row, column, keepDesiredColumn) {
|
||||
// Ensure the row/column is not inside of a fold.
|
||||
var fold = this.session.getFoldAt(row, column, 1);
|
||||
|
|
@ -823,13 +822,13 @@ var Selection = function(session) {
|
|||
};
|
||||
|
||||
/**
|
||||
* Selection.moveCursorToScreen(row, column, keepDesiredColumn)
|
||||
* Selection.moveCursorToScreen(row, column, keepDesiredColumn)
|
||||
* - row (Number): The row to move to
|
||||
* - column (Number): The column to move to
|
||||
* - keepDesiredColumn (Boolean): {:preventUpdateBool}
|
||||
*
|
||||
* Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc}
|
||||
**/
|
||||
**/
|
||||
this.moveCursorToScreen = function(row, column, keepDesiredColumn) {
|
||||
var pos = this.session.screenToDocumentPosition(row, column);
|
||||
this.moveCursorTo(pos.row, pos.column, keepDesiredColumn);
|
||||
|
|
|
|||
|
|
@ -39,4 +39,4 @@
|
|||
|
||||
require("amd-loader");
|
||||
var test = require("asyncjs").test;
|
||||
test.walkTestCases(__dirname + "/..").exec();
|
||||
test.walkTestCases(__dirname + "/..").exec();
|
||||
|
|
|
|||
|
|
@ -60,4 +60,4 @@ exports.jsonEquals = function(foundJson, expectedJson) {
|
|||
|
||||
module.exports = assert;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -310,4 +310,4 @@ assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
|
|||
|
||||
assert.ifError = function(err) { if (err) {throw err;}};
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -360,7 +360,7 @@ exports.Generator = function(source) {
|
|||
}
|
||||
|
||||
this.end = function(breakOnError, callback) {
|
||||
if (!callback) {
|
||||
if (!callback) {
|
||||
callback = arguments[0]
|
||||
breakOnError = true
|
||||
}
|
||||
|
|
@ -526,4 +526,4 @@ exports.plugin = function(members, constructors) {
|
|||
}
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -10,4 +10,4 @@ module.exports = require("./async")
|
|||
module.exports.test = require("./test")
|
||||
require("./utils")
|
||||
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -192,4 +192,4 @@ exports.testcase = function(testcase, suiteName, timeout) {
|
|||
return async.list(tests, exports.TestGenerator)
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -62,4 +62,4 @@ async.plugin({
|
|||
}
|
||||
})
|
||||
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -82,4 +82,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ global.document = browser.document;
|
|||
global.window = browser.window;
|
||||
global.self = browser.self;
|
||||
global.navigator = browser.navigator;
|
||||
global.location = browser.location;
|
||||
global.location = browser.location;
|
||||
|
|
|
|||
|
|
@ -216,4 +216,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,4 +104,4 @@ function addUnicodePackage (pack) {
|
|||
exports.packages[name] = pack[name].replace(codePoint, "\\u$&");
|
||||
};
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -88,4 +88,4 @@ module.exports = {
|
|||
|
||||
if (typeof module !== "undefined" && module === require.main) {
|
||||
require("asyncjs").test.testcase(module.exports).exec()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4466,4 +4466,4 @@ loop: for (;;) {
|
|||
if (typeof exports === 'object' && exports)
|
||||
exports.JSHINT = JSHINT;
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6393,4 +6393,4 @@ klass: do {
|
|||
return itself;
|
||||
}());
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -40,4 +40,4 @@ var Mirror = exports.Mirror = function(sender) {
|
|||
|
||||
}).call(Mirror.prototype);
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue