Refresh master with initial release/0.24 snapshot (#332)

* Initial port of release/0.24 source code

* Fix additional headers

* Fix a typo in launch.json
This commit is contained in:
Karl Burtram
2017-12-15 15:38:57 -08:00
committed by GitHub
parent 271b3a0b82
commit 6ad0df0e3e
7118 changed files with 107999 additions and 56466 deletions

View File

@@ -31,6 +31,17 @@ export const enum RevealTarget {
BottomMost = 2
}
/**
* This is an operation type that will be recorded for undo/redo purposes.
* The goal is to introduce an undo stop when the controller switches between different operation types.
*/
export const enum EditOperationType {
Other = 0,
Typing = 1,
DeletingLeft = 2,
DeletingRight = 3
}
export interface ICursors {
readonly context: CursorContext;
getPrimaryCursor(): CursorState;
@@ -45,6 +56,9 @@ export interface ICursors {
revealRange(revealHorizontal: boolean, viewRange: Range, verticalType: VerticalRevealType, scrollType: ScrollType): void;
scrollTo(desiredScrollTop: number): void;
getPrevEditOperationType(): EditOperationType;
setPrevEditOperationType(type: EditOperationType): void;
}
export interface CharacterMap {
@@ -422,17 +436,20 @@ export class CursorState {
export class EditOperationResult {
_editOperationResultBrand: void;
readonly type: EditOperationType;
readonly commands: ICommand[];
readonly shouldPushStackElementBefore: boolean;
readonly shouldPushStackElementAfter: boolean;
constructor(
type: EditOperationType,
commands: ICommand[],
opts: {
shouldPushStackElementBefore: boolean;
shouldPushStackElementAfter: boolean;
}
) {
this.type = type;
this.commands = commands;
this.shouldPushStackElementBefore = opts.shouldPushStackElementBefore;
this.shouldPushStackElementAfter = opts.shouldPushStackElementAfter;