提交 a0e4acb4 编写于 作者: A Alex Dima

Simplify cursor events

上级 354e809c
......@@ -364,12 +364,9 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
}
const e: ICursorPositionChangedEvent = {
position: primaryPosition,
viewPosition: primaryViewPosition,
secondaryPositions: secondaryPositions,
secondaryViewPositions: secondaryViewPositions,
reason: reason,
source: source,
isInEditableRange: isInEditableRange
source: source
};
this._eventEmitter.emit(CursorEventType.CursorPositionChanged, e);
this._emit([new viewEvents.ViewCursorPositionChangedEvent(primaryViewPosition, secondaryViewPositions, isInEditableRange)]);
......@@ -386,9 +383,7 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
const e: ICursorSelectionChangedEvent = {
selection: primarySelection,
viewSelection: primaryViewSelection,
secondarySelections: secondarySelections,
secondaryViewSelections: secondaryViewSelections,
source: source || 'keyboard',
reason: reason
};
......
......@@ -57,18 +57,10 @@ export interface ICursorPositionChangedEvent {
* Primary cursor's position.
*/
readonly position: Position;
/**
* Primary cursor's view position
*/
readonly viewPosition: Position;
/**
* Secondary cursors' position.
*/
readonly secondaryPositions: Position[];
/**
* Secondary cursors' view position.
*/
readonly secondaryViewPositions: Position[];
/**
* Reason.
*/
......@@ -77,10 +69,6 @@ export interface ICursorPositionChangedEvent {
* Source of the call that caused the event.
*/
readonly source: string;
/**
* Is the primary cursor in the editable range?
*/
readonly isInEditableRange: boolean;
}
/**
* An event describing that the cursor selection has changed.
......@@ -90,18 +78,10 @@ export interface ICursorSelectionChangedEvent {
* The primary selection.
*/
readonly selection: Selection;
/**
* The primary selection in view coordinates.
*/
readonly viewSelection: Selection;
/**
* The secondary selections.
*/
readonly secondarySelections: Selection[];
/**
* The secondary selections in view coordinates.
*/
readonly secondaryViewSelections: Selection[];
/**
* Source of the call that caused the event.
*/
......
......@@ -2528,18 +2528,10 @@ declare module monaco.editor {
* Primary cursor's position.
*/
readonly position: Position;
/**
* Primary cursor's view position
*/
readonly viewPosition: Position;
/**
* Secondary cursors' position.
*/
readonly secondaryPositions: Position[];
/**
* Secondary cursors' view position.
*/
readonly secondaryViewPositions: Position[];
/**
* Reason.
*/
......@@ -2548,10 +2540,6 @@ declare module monaco.editor {
* Source of the call that caused the event.
*/
readonly source: string;
/**
* Is the primary cursor in the editable range?
*/
readonly isInEditableRange: boolean;
}
/**
......@@ -2562,18 +2550,10 @@ declare module monaco.editor {
* The primary selection.
*/
readonly selection: Selection;
/**
* The primary selection in view coordinates.
*/
readonly viewSelection: Selection;
/**
* The secondary selections.
*/
readonly secondarySelections: Selection[];
/**
* The secondary selections in view coordinates.
*/
readonly secondaryViewSelections: Selection[];
/**
* Source of the call that caused the event.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册