2016-07-15 12:39:15 +02:00
|
|
|
/*---------------------------------------------------------------------------------------------
|
|
|
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
|
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
|
'use strict';
|
|
|
|
|
|
2016-07-25 16:59:01 +02:00
|
|
|
import * as vscode from 'vscode';
|
2016-07-15 12:39:15 +02:00
|
|
|
import {MotionState, Motion} from './motions';
|
|
|
|
|
|
|
|
|
|
export enum Mode {
|
|
|
|
|
INSERT,
|
|
|
|
|
NORMAL,
|
|
|
|
|
REPLACE
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class DeleteRegister {
|
|
|
|
|
public isWholeLine:boolean;
|
|
|
|
|
public content:string;
|
|
|
|
|
|
|
|
|
|
constructor(isWholeLine:boolean, content:string) {
|
|
|
|
|
this.isWholeLine = isWholeLine;
|
|
|
|
|
this.content = content;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IController {
|
|
|
|
|
motionState: MotionState;
|
|
|
|
|
|
|
|
|
|
setMode(mode: Mode): void;
|
|
|
|
|
setVisual(newVisual:boolean): void;
|
|
|
|
|
findMotion(input: string): Motion;
|
|
|
|
|
isMotionPrefix(input: string): boolean;
|
|
|
|
|
|
|
|
|
|
setDeleteRegister(register:DeleteRegister): void;
|
|
|
|
|
getDeleteRegister(): DeleteRegister;
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-25 16:59:01 +02:00
|
|
|
export abstract class AbstractCommandDescriptor {
|
|
|
|
|
|
|
|
|
|
public abstract createCommand(args?: any): Command;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2016-07-15 12:39:15 +02:00
|
|
|
export interface Command {
|
|
|
|
|
commandId: string,
|
2016-07-25 16:59:01 +02:00
|
|
|
args?: any[]
|
2016-07-15 12:39:15 +02:00
|
|
|
}
|