Skip to content

Commit

Permalink
Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnfn committed Jun 8, 2016
1 parent 173486d commit a4b2e6c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 29 deletions.
2 changes: 0 additions & 2 deletions src/mode/modeHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,6 @@ export class ModeHandler implements vscode.Disposable {
actionState.actionKeys.push(key);
vimState.dotKeys.push(key);

console.log(vimState.dotKeys.join(""));

let action = Actions.getRelevantAction(actionState.actionKeys, vimState);

if (action === KeypressState.NoPossibleMatch) {
Expand Down
9 changes: 0 additions & 9 deletions src/mode/modeInsert.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
"use strict";

import { ModeName, Mode } from './mode';
import { TextEditor } from './../textEditor';
import { ActionState } from './modeHandler';

export class InsertMode extends Mode {
constructor() {
super(ModeName.Insert);
}

async handleAction(action: ActionState): Promise<void> {
// TODO: REALLY dumb, especially since there are actually actions
// that work in insert mode.

// await TextEditor.insert(action.keysPressed[0]);
}
}
28 changes: 10 additions & 18 deletions test/mode/modeHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import * as assert from 'assert';
import * as vscode from 'vscode';
import {setupWorkspace, cleanUpWorkspace} from './../testUtils';
import {ModeName} from '../../src/mode/mode';
import {ModeHandler} from '../../src/mode/modeHandler';
import { setupWorkspace, cleanUpWorkspace } from './../testUtils';
import { ModeName } from '../../src/mode/mode';
import { ModeHandler } from '../../src/mode/modeHandler';

suite("Mode Handler", () => {

Expand All @@ -19,33 +19,25 @@ suite("Mode Handler", () => {
assert.equal(modeHandler.currentMode.isActive, true);
});

test("TODO", () => {
assert.equal(true, false, "FAIL!!!");
})

/*
test("can set current mode", () => {
test("can set current mode", async () => {
var modeHandler = new ModeHandler();

modeHandler.setCurrentModeByName(ModeName.Normal);
assert.equal(modeHandler.currentMode.name, ModeName.Normal);

modeHandler.setCurrentModeByName(ModeName.Insert);
await modeHandler.handleKeyEvent("i");
assert.equal(modeHandler.currentMode.name, ModeName.Insert);
});

test("Uses correct cursor style depending on mode", async () => {
const modeHandler = new ModeHandler();

modeHandler.setCurrentModeByName(ModeName.Normal);
assert.equal(vscode.window.activeTextEditor.options.cursorStyle, vscode.TextEditorCursorStyle.Block);
assert.equal((vscode.window.activeTextEditor.options as any).cursorStyle, (vscode as any).TextEditorCursorStyle.Block);

modeHandler.setCurrentModeByName(ModeName.Insert);
assert.equal(vscode.window.activeTextEditor.options.cursorStyle, vscode.TextEditorCursorStyle.Line);
await modeHandler.handleKeyEvent("i");
assert.equal((vscode.window.activeTextEditor.options as any).cursorStyle, (vscode as any).TextEditorCursorStyle.Line);

modeHandler.setCurrentModeByName(ModeName.Visual);
assert.equal(vscode.window.activeTextEditor.options.cursorStyle, vscode.TextEditorCursorStyle.Block);
await modeHandler.handleMultipleKeyEvents(["<esc>", "v"]);
assert.equal((vscode.window.activeTextEditor.options as any).cursorStyle, (vscode as any).TextEditorCursorStyle.Block);
});
*/

});

0 comments on commit a4b2e6c

Please sign in to comment.