提交 235bdabe 编写于 作者: A Alex Dima

Move SelectionDirection to selection.ts

上级 7f14d8c3
......@@ -41,10 +41,10 @@ declare module monaco {
#include(vs/base/browser/keyboardEvent): IKeyboardEvent
#include(vs/base/browser/mouseEvent): IMouseEvent
#include(vs/editor/common/editorCommon): IScrollEvent
#include(vs/editor/common/editorCommon): IPosition, IRange, SelectionDirection, ISelection
#include(vs/editor/common/editorCommon): IPosition, IRange, ISelection
#include(vs/editor/common/core/position): Position
#include(vs/editor/common/core/range): Range
#include(vs/editor/common/core/selection): Selection
#include(vs/editor/common/core/selection): Selection, SelectionDirection
}
declare module monaco.editor {
......
......@@ -13,7 +13,7 @@ import {CursorCollection, ICursorCollectionState} from 'vs/editor/common/control
import {WordNavigationType, IOneCursorOperationContext, IPostOperationRunnable, IViewModelHelper, OneCursor, OneCursorOp} from 'vs/editor/common/controller/oneCursor';
import {Position} from 'vs/editor/common/core/position';
import {Range} from 'vs/editor/common/core/range';
import {Selection} from 'vs/editor/common/core/selection';
import {Selection, SelectionDirection} from 'vs/editor/common/core/selection';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {IColumnSelectResult} from 'vs/editor/common/controller/cursorMoveHelper';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
......@@ -527,7 +527,7 @@ export class Cursor extends EventEmitter {
}
}
} else {
if (selection.getDirection() === editorCommon.SelectionDirection.LTR) {
if (selection.getDirection() === SelectionDirection.LTR) {
selectionMarkerStickToPreviousCharacter = false;
positionMarkerStickToPreviousCharacter = true;
} else {
......
......@@ -12,7 +12,7 @@ import {SurroundSelectionCommand} from 'vs/editor/common/commands/surroundSelect
import {CursorMoveHelper, ICursorMoveHelperModel, IMoveResult, IColumnSelectResult, IViewColumnSelectResult} from 'vs/editor/common/controller/cursorMoveHelper';
import {Position} from 'vs/editor/common/core/position';
import {Range} from 'vs/editor/common/core/range';
import {Selection} from 'vs/editor/common/core/selection';
import {Selection, SelectionDirection} from 'vs/editor/common/core/selection';
import * as editorCommon from 'vs/editor/common/editorCommon';
import {IElectricAction, IndentAction} from 'vs/editor/common/modes';
import {LanguageConfigurationRegistry} from 'vs/editor/common/modes/languageConfigurationRegistry';
......@@ -144,7 +144,7 @@ export class OneCursor {
private _cachedViewSelection: Selection;
private _selStartMarker: string;
private _selEndMarker: string;
private _selDirection: editorCommon.SelectionDirection;
private _selDirection: SelectionDirection;
constructor(
editorId: number,
......@@ -415,7 +415,7 @@ export class OneCursor {
let start = this.model._getMarker(this._selStartMarker);
let end = this.model._getMarker(this._selEndMarker);
if (this._selDirection === editorCommon.SelectionDirection.LTR) {
if (this._selDirection === SelectionDirection.LTR) {
return new Selection(start.lineNumber, start.column, end.lineNumber, end.column);
}
......
......@@ -5,7 +5,21 @@
'use strict';
import {Range} from 'vs/editor/common/core/range';
import {ISelection, SelectionDirection} from 'vs/editor/common/editorCommon';
import {ISelection} from 'vs/editor/common/editorCommon';
/**
* The direction of a selection.
*/
export enum SelectionDirection {
/**
* The selection starts above where it ends.
*/
LTR,
/**
* The selection starts below where it ends.
*/
RTL
}
/**
* A selection in the editor.
......
......@@ -87,20 +87,6 @@ export interface ISelection {
positionColumn: number;
}
/**
* The direction of a selection.
*/
export enum SelectionDirection {
/**
* The selection starts above where it ends.
*/
LTR,
/**
* The selection starts below where it ends.
*/
RTL
}
/**
* Configuration options for editor scrollbars
*/
......
......@@ -8,8 +8,7 @@ import {Emitter} from 'vs/base/common/event';
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
import {Position} from 'vs/editor/common/core/position';
import {Range} from 'vs/editor/common/core/range';
import {Selection} from 'vs/editor/common/core/selection';
import {SelectionDirection} from 'vs/editor/common/editorCommon';
import {Selection, SelectionDirection} from 'vs/editor/common/core/selection';
import {TPromise} from 'vs/base/common/winjs.base';
import {CancellationTokenSource} from 'vs/base/common/cancellation';
import Severity from 'vs/base/common/severity';
......
......@@ -5,7 +5,7 @@
'use strict';
import {Range} from 'vs/editor/common/core/range';
import {Selection} from 'vs/editor/common/core/selection';
import {Selection, SelectionDirection} from 'vs/editor/common/core/selection';
import * as editorCommon from 'vs/editor/common/editorCommon';
export class CopyLinesCommand implements editorCommon.ICommand {
......@@ -13,7 +13,7 @@ export class CopyLinesCommand implements editorCommon.ICommand {
private _selection: Selection;
private _isCopyingDown: boolean;
private _selectionDirection:editorCommon.SelectionDirection;
private _selectionDirection:SelectionDirection;
private _selectionId: string;
private _startLineNumberDelta: number;
private _endLineNumberDelta: number;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册