removing trailing whitespace

This commit is contained in:
Robert Krahn 2013-02-18 23:37:53 -08:00
commit ac1b5f4f37
2 changed files with 24 additions and 24 deletions

View file

@ -66,7 +66,7 @@ var EditSession = require("./edit_session").EditSession;
// automatically sorted list of ranges // automatically sorted list of ranges
this.rangeList = null; this.rangeList = null;
/** /**
* Adds a range to a selection by entering multiselect mode, if necessary. * Adds a range to a selection by entering multiselect mode, if necessary.
* @param {Range} range The new range to add * @param {Range} range The new range to add
* @param {Boolean} $blockChangeEvents Whether or not to block changing events * @param {Boolean} $blockChangeEvents Whether or not to block changing events
@ -218,7 +218,7 @@ var EditSession = require("./edit_session").EditSession;
var start = range.end, end = range.start; var start = range.end, end = range.start;
else else
var start = range.start, end = range.end; var start = range.start, end = range.end;
this.addRange(Range.fromPoints(end, end)); this.addRange(Range.fromPoints(end, end));
this.addRange(Range.fromPoints(start, start)); this.addRange(Range.fromPoints(start, start));
return; return;
@ -261,9 +261,9 @@ var EditSession = require("./edit_session").EditSession;
}; };
/** /**
* *
* Gets list of ranges composing rectangular block on the screen * Gets list of ranges composing rectangular block on the screen
* *
* @param {Cursor} screenCursor The cursor to use * @param {Cursor} screenCursor The cursor to use
* @param {Anchor} screenAnchor The anchor to use * @param {Anchor} screenAnchor The anchor to use
* @param {Boolean} includeEmptyLines If true, this includes ranges inside the block which are empty due to clipping * @param {Boolean} includeEmptyLines If true, this includes ranges inside the block which are empty due to clipping
@ -339,8 +339,8 @@ var EditSession = require("./edit_session").EditSession;
var Editor = require("./editor").Editor; var Editor = require("./editor").Editor;
(function() { (function() {
/** /**
* *
* Updates the cursor and marker layers. * Updates the cursor and marker layers.
* @method Editor.updateSelectionMarkers * @method Editor.updateSelectionMarkers
* *
@ -350,7 +350,7 @@ var Editor = require("./editor").Editor;
this.renderer.updateBackMarkers(); this.renderer.updateBackMarkers();
}; };
/** /**
* Adds the selection and cursor. * Adds the selection and cursor.
* @param {Range} orientedRange A range containing a cursor * @param {Range} orientedRange A range containing a cursor
* @returns {Range} * @returns {Range}
@ -368,7 +368,7 @@ var Editor = require("./editor").Editor;
return orientedRange; return orientedRange;
}; };
/** /**
* Removes the selection marker. * Removes the selection marker.
* @param {Range} The selection range added with [[Editor.addSelectionMarker `addSelectionMarker()`]]. * @param {Range} The selection range added with [[Editor.addSelectionMarker `addSelectionMarker()`]].
* @method Editor.removeSelectionMarker * @method Editor.removeSelectionMarker
@ -455,12 +455,12 @@ var Editor = require("./editor").Editor;
e.preventDefault(); e.preventDefault();
}; };
/** /**
* Executes a command for each selection range. * Executes a command for each selection range.
* @param {String} cmd The command to execute * @param {String} cmd The command to execute
* @param {String} args Any arguments for the command * @param {String} args Any arguments for the command
* @method Editor.forEachSelection * @method Editor.forEachSelection
**/ **/
this.forEachSelection = function(cmd, args) { this.forEachSelection = function(cmd, args) {
if (this.inVirtualSelectionMode) if (this.inVirtualSelectionMode)
return; return;
@ -491,7 +491,7 @@ var Editor = require("./editor").Editor;
this.onSelectionChange(); this.onSelectionChange();
}; };
/** /**
* Removes all the selections except the last added one. * Removes all the selections except the last added one.
* @method Editor.exitMultiSelectMode * @method Editor.exitMultiSelectMode
**/ **/
@ -547,7 +547,7 @@ var Editor = require("./editor").Editor;
* @param {Object} The search options * @param {Object} The search options
* @param {Boolean} keeps * @param {Boolean} keeps
* *
* @returns {Number} The cumulative count of all found matches * @returns {Number} The cumulative count of all found matches
* @method Editor.findAll * @method Editor.findAll
**/ **/
this.findAll = function(needle, options, additive) { this.findAll = function(needle, options, additive) {
@ -575,11 +575,11 @@ var Editor = require("./editor").Editor;
/** /**
* Adds a cursor above or below the active cursor. * Adds a cursor above or below the active cursor.
* *
* @param {Number} dir The direction of lines to select: -1 for up, 1 for down * @param {Number} dir The direction of lines to select: -1 for up, 1 for down
* @param {Boolean} skip If `true`, removes the active selection range * @param {Boolean} skip If `true`, removes the active selection range
* *
* @method Editor.selectMoreLines * @method Editor.selectMoreLines
*/ */
this.selectMoreLines = function(dir, skip) { this.selectMoreLines = function(dir, skip) {
var range = this.selection.toOrientedRange(); var range = this.selection.toOrientedRange();
@ -619,7 +619,7 @@ var Editor = require("./editor").Editor;
this.selection.substractPoint(toRemove); this.selection.substractPoint(toRemove);
}; };
/** /**
* Transposes the selected ranges. * Transposes the selected ranges.
* @param {Number} dir The direction to rotate selections * @param {Number} dir The direction to rotate selections
* @method Editor.transposeSelections * @method Editor.transposeSelections
@ -661,7 +661,7 @@ var Editor = require("./editor").Editor;
} }
}; };
/** /**
* Finds the next occurence of text in an active selection and adds it to the selections. * Finds the next occurence of text in an active selection and adds it to the selections.
* @param {Number} dir The direction of lines to select: -1 for up, 1 for down * @param {Number} dir The direction of lines to select: -1 for up, 1 for down
* @param {Boolean} skip If `true`, removes the active selection range * @param {Boolean} skip If `true`, removes the active selection range
@ -688,7 +688,7 @@ var Editor = require("./editor").Editor;
this.multiSelect.substractPoint(range.cursor); this.multiSelect.substractPoint(range.cursor);
}; };
/** /**
* Aligns the cursors or selected text. * Aligns the cursors or selected text.
* @method Editor.alignCursors * @method Editor.alignCursors
**/ **/

View file

@ -3,7 +3,7 @@
* *
* Copyright (c) 2010, Ajax.org B.V. * Copyright (c) 2010, Ajax.org B.V.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
@ -14,7 +14,7 @@
* * Neither the name of Ajax.org B.V. nor the * * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@ -42,7 +42,7 @@ var Range = require("./range").Range;
var assert = require("./test/assertions"); var assert = require("./test/assertions");
var MultiSelect = require("./multi_select").MultiSelect; var MultiSelect = require("./multi_select").MultiSelect;
var editor var editor;
var exec = function(name, times, args) { var exec = function(name, times, args) {
do { do {
editor.commands.exec(name, editor, args); editor.commands.exec(name, editor, args);
@ -126,7 +126,7 @@ module.exports = {
editor.setSession(doc); editor.setSession(doc);
assert.ok(editor.inMultiSelectMode); assert.ok(editor.inMultiSelectMode);
}, },
"test: multiselect addRange": function() { "test: multiselect addRange": function() {
var doc = new EditSession([ var doc = new EditSession([
"w1.w2", "w1.w2",
@ -139,17 +139,17 @@ module.exports = {
var range1 = new Range(0, 2, 0, 4); var range1 = new Range(0, 2, 0, 4);
editor.selection.fromOrientedRange(range1); editor.selection.fromOrientedRange(range1);
var range2 = new Range(0, 3, 0, 4); var range2 = new Range(0, 3, 0, 4);
selection.addRange(range2); selection.addRange(range2);
assert.ok(!editor.inMultiSelectMode); assert.ok(!editor.inMultiSelectMode);
assert.ok(range2.isEqual(editor.selection.getRange())); assert.ok(range2.isEqual(editor.selection.getRange()));
var range3 = new Range(0, 1, 0, 1); var range3 = new Range(0, 1, 0, 1);
selection.addRange(range3); selection.addRange(range3);
assert.ok(editor.inMultiSelectMode); assert.ok(editor.inMultiSelectMode);
testRanges([range3, range2]); testRanges([range3, range2]);
var range4 = new Range(0, 0, 4, 0); var range4 = new Range(0, 0, 4, 0);
selection.addRange(range4); selection.addRange(range4);
assert.ok(!editor.inMultiSelectMode); assert.ok(!editor.inMultiSelectMode);