removing trailing whitespace
This commit is contained in:
parent
ac3a7e2bbb
commit
ac1b5f4f37
2 changed files with 24 additions and 24 deletions
|
|
@ -66,7 +66,7 @@ var EditSession = require("./edit_session").EditSession;
|
|||
// automatically sorted list of ranges
|
||||
this.rangeList = null;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Adds a range to a selection by entering multiselect mode, if necessary.
|
||||
* @param {Range} range The new range to add
|
||||
* @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;
|
||||
else
|
||||
var start = range.start, end = range.end;
|
||||
|
||||
|
||||
this.addRange(Range.fromPoints(end, end));
|
||||
this.addRange(Range.fromPoints(start, start));
|
||||
return;
|
||||
|
|
@ -261,9 +261,9 @@ var EditSession = require("./edit_session").EditSession;
|
|||
};
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* Gets list of ranges composing rectangular block on the screen
|
||||
*
|
||||
*
|
||||
* @param {Cursor} screenCursor The cursor 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
|
||||
|
|
@ -339,8 +339,8 @@ var EditSession = require("./edit_session").EditSession;
|
|||
var Editor = require("./editor").Editor;
|
||||
(function() {
|
||||
|
||||
/**
|
||||
*
|
||||
/**
|
||||
*
|
||||
* Updates the cursor and marker layers.
|
||||
* @method Editor.updateSelectionMarkers
|
||||
*
|
||||
|
|
@ -350,7 +350,7 @@ var Editor = require("./editor").Editor;
|
|||
this.renderer.updateBackMarkers();
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* Adds the selection and cursor.
|
||||
* @param {Range} orientedRange A range containing a cursor
|
||||
* @returns {Range}
|
||||
|
|
@ -368,7 +368,7 @@ var Editor = require("./editor").Editor;
|
|||
return orientedRange;
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* Removes the selection marker.
|
||||
* @param {Range} The selection range added with [[Editor.addSelectionMarker `addSelectionMarker()`]].
|
||||
* @method Editor.removeSelectionMarker
|
||||
|
|
@ -455,12 +455,12 @@ var Editor = require("./editor").Editor;
|
|||
e.preventDefault();
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* Executes a command for each selection range.
|
||||
* @param {String} cmd The command to execute
|
||||
* @param {String} args Any arguments for the command
|
||||
* @method Editor.forEachSelection
|
||||
**/
|
||||
**/
|
||||
this.forEachSelection = function(cmd, args) {
|
||||
if (this.inVirtualSelectionMode)
|
||||
return;
|
||||
|
|
@ -491,7 +491,7 @@ var Editor = require("./editor").Editor;
|
|||
this.onSelectionChange();
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* Removes all the selections except the last added one.
|
||||
* @method Editor.exitMultiSelectMode
|
||||
**/
|
||||
|
|
@ -547,7 +547,7 @@ var Editor = require("./editor").Editor;
|
|||
* @param {Object} The search options
|
||||
* @param {Boolean} keeps
|
||||
*
|
||||
* @returns {Number} The cumulative count of all found matches
|
||||
* @returns {Number} The cumulative count of all found matches
|
||||
* @method Editor.findAll
|
||||
**/
|
||||
this.findAll = function(needle, options, additive) {
|
||||
|
|
@ -575,11 +575,11 @@ var Editor = require("./editor").Editor;
|
|||
|
||||
/**
|
||||
* 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 {Boolean} skip If `true`, removes the active selection range
|
||||
*
|
||||
* @method Editor.selectMoreLines
|
||||
* @method Editor.selectMoreLines
|
||||
*/
|
||||
this.selectMoreLines = function(dir, skip) {
|
||||
var range = this.selection.toOrientedRange();
|
||||
|
|
@ -619,7 +619,7 @@ var Editor = require("./editor").Editor;
|
|||
this.selection.substractPoint(toRemove);
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* Transposes the selected ranges.
|
||||
* @param {Number} dir The direction to rotate selections
|
||||
* @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.
|
||||
* @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
|
||||
|
|
@ -688,7 +688,7 @@ var Editor = require("./editor").Editor;
|
|||
this.multiSelect.substractPoint(range.cursor);
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* Aligns the cursors or selected text.
|
||||
* @method Editor.alignCursors
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* * Neither the name of Ajax.org B.V. nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* 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 MultiSelect = require("./multi_select").MultiSelect;
|
||||
|
||||
var editor
|
||||
var editor;
|
||||
var exec = function(name, times, args) {
|
||||
do {
|
||||
editor.commands.exec(name, editor, args);
|
||||
|
|
@ -126,7 +126,7 @@ module.exports = {
|
|||
editor.setSession(doc);
|
||||
assert.ok(editor.inMultiSelectMode);
|
||||
},
|
||||
|
||||
|
||||
"test: multiselect addRange": function() {
|
||||
var doc = new EditSession([
|
||||
"w1.w2",
|
||||
|
|
@ -139,17 +139,17 @@ module.exports = {
|
|||
|
||||
var range1 = new Range(0, 2, 0, 4);
|
||||
editor.selection.fromOrientedRange(range1);
|
||||
|
||||
|
||||
var range2 = new Range(0, 3, 0, 4);
|
||||
selection.addRange(range2);
|
||||
assert.ok(!editor.inMultiSelectMode);
|
||||
assert.ok(range2.isEqual(editor.selection.getRange()));
|
||||
|
||||
|
||||
var range3 = new Range(0, 1, 0, 1);
|
||||
selection.addRange(range3);
|
||||
assert.ok(editor.inMultiSelectMode);
|
||||
testRanges([range3, range2]);
|
||||
|
||||
|
||||
var range4 = new Range(0, 0, 4, 0);
|
||||
selection.addRange(range4);
|
||||
assert.ok(!editor.inMultiSelectMode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue