Run through and fix broken text items

This commit is contained in:
Garen Torikian 2013-01-04 16:43:17 -08:00 • committed by nightwing
commit e56ab9d4ab
33 changed files with 1171 additions and 1276 deletions

View file

@ -96,7 +96,12 @@ exports.edit = function(el) {
return editor;
};
/**
* Creates a new [[EditSession]], and returns the associated [[Document]].
* @param {Document | String} text {:textParam}
* @param {TextMode} mode {:modeParam}
*
**/
exports.createEditSession = function(text, mode) {
var doc = new EditSession(text, doc);
doc.setUndoManager(new UndoManager());

View file

@ -143,9 +143,8 @@ var SearchHighlight = require("./search_highlight").SearchHighlight;
/**
*
* Sets up a new `EditSession` and associates it with the given `Document` and `TextMode`.
* @param {Document | String} text If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text
*
* @param {TextMode} mode The inital language mode to use for the document
* @param {Document | String} text [If `text` is a `Document`, it associates the `EditSession` with it. Otherwise, a new `Document` is created, with the initial text]{: #textParam}
* @param {TextMode} mode [The inital language mode to use for the document]{: #modeParam}
*
* @constructor
**/
@ -306,6 +305,7 @@ var EditSession = function(text, mode) {
/**
* Returns the current [[Document `Document`]] as a string.
* @method toString
* @returns {String}
* @alias EditSession.getValue
*
**/
@ -313,6 +313,7 @@ var EditSession = function(text, mode) {
/**
* Returns the current [[Document `Document`]] as a string.
* @method getValue
* @returns {String}
* @alias EditSession.toString
**/
this.getValue =
@ -565,7 +566,7 @@ var EditSession = function(text, mode) {
/**
* Returns an array of numbers, indicating which rows have breakpoints.
* @returns [Number]
* @returns {[Number]}
**/
this.getBreakpoints = function() {
return this.$breakpoints;
@ -573,7 +574,7 @@ var EditSession = function(text, mode) {
/**
* Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event.
* @param {Number} rows An array of row indicies
* @param {Array} rows An array of row indices
*
*
*
@ -630,7 +631,7 @@ var EditSession = function(text, mode) {
* @param {Boolean} inFront Set to `true` to establish a front marker
*
*
* @return {Number}
* @return {Number} The new marker id
**/
this.addMarker = function(range, clazz, type, inFront) {
var id = this.$markerId++;
@ -1120,7 +1121,7 @@ var EditSession = function(text, mode) {
* @param {Number} firstRow The first row index to retrieve
* @param {Number} lastRow The final row index to retrieve
*
* @returns [String]
* @returns {[String]}
*
**/
this.getLines = function(firstRow, lastRow) {
@ -1619,6 +1620,7 @@ var EditSession = function(text, mode) {
/**
* Returns the value of wrap limit.
* @returns {Number} The wrap limit.
**/
this.getWrapLimit = function() {
return this.$wrapLimit;
@ -2350,10 +2352,15 @@ var EditSession = function(text, mode) {
}
return screenRows;
}
};
// For every keystroke this gets called once per char in the whole doc!!
// Wouldn't hurt to make it a bit faster for c >= 0x1100
/**
* @private
*
*/
function isFullWidth(c) {
if (c < 0x1100)
return false;

View file

@ -249,7 +249,7 @@ function Folding() {
return foldLine;
};
/*
/**
* Adds a new fold.
*
* @returns

View file

@ -250,8 +250,6 @@ var Editor = function(renderer, session) {
* @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 value
* @related Document.setValue
**/
@ -1523,9 +1521,11 @@ var Editor = function(renderer, session) {
/**
* Returns an object indicating the currently selected rows. The object looks like this:
*
* ```json
* { first: range.start.row, last: range.end.row }
* ```
*
* @returns {Object}
**/
this.$getSelectedRows = function() {
@ -1551,6 +1551,7 @@ var Editor = function(renderer, session) {
/**
* {:VirtualRenderer.getFirstVisibleRow}
*
* @returns {Number}
* @related VirtualRenderer.getFirstVisibleRow
**/
@ -1560,6 +1561,7 @@ var Editor = function(renderer, session) {
/**
* {:VirtualRenderer.getLastVisibleRow}
*
* @returns {Number}
* @related VirtualRenderer.getLastVisibleRow
**/
@ -1700,6 +1702,7 @@ var Editor = function(renderer, session) {
/**
* Gets the current position of the cursor.
* @returns {Object} An object that looks something like this:
*
* ```json
* { row: currRow, column: currCol }
* ```

View file

@ -223,8 +223,7 @@ StateHandler.prototype = {
* This is a useful matching function and therefore is defined here so that
* users of KeyboardStateMapper can use it.
*
* @return {Boolean}
* If no command key (Command|Option|Shift|Ctrl) is pressed, it
* @return {Boolean} If no command key (Command|Option|Shift|Ctrl) is pressed, it
* returns true. If the only the Shift key is pressed + a character
* true is returned as well. Otherwise, false is returned.
* Summing up, the function returns true whenever the user typed

View file

@ -543,10 +543,11 @@ var Editor = require("./editor").Editor;
/**
* Finds and selects all the occurences of `needle`.
* @param {String} needle The text to find
* @param {Object} options The search options
* @param {Boolean} additive Keeps
* @returns {Number}
* @param {String} The text to find
* @param {Object} The search options
* @param {Boolean} keeps
*
* @returns {Number} The cumulative count of all found matches
* @method Editor.findAll
**/
this.findAll = function(needle, options, additive) {
@ -620,7 +621,7 @@ var Editor = require("./editor").Editor;
/**
* Transposes the selected ranges.
* @param dir {Number} The direction to rotate selections
* @param {Number} dir The direction to rotate selections
* @method Editor.transposeSelections
**/
this.transposeSelections = function(dir) {

View file

@ -125,7 +125,7 @@ var Search = function() {
* @param {EditSession} session The session to search with
*
*
* @returns [Range]
* @returns {[Range]}
**/
this.findAll = function(session) {
var options = this.$options;

View file

@ -144,6 +144,8 @@ var Selection = function(session) {
/**
* Returns an object containing the `row` and `column` of the calling selection anchor.
*
* @returns {Object}
* @related Anchor.getPosition
**/
this.getSelectionAnchor = function() {

View file

@ -60,7 +60,7 @@ var TokenIterator = function(session, initialRow, initialColumn) {
/**
*
* Tokenizes all the items from the current point to the row prior in the document.
* @returns [String] If the current point is not at the top of the file, this function returns `null`. Otherwise, it returns an array of the tokenized strings.
* @returns {[String]} If the current point is not at the top of the file, this function returns `null`. Otherwise, it returns an array of the tokenized strings.
**/
this.stepBackward = function() {
this.$tokenIndex -= 1;