emit event when changing mode

This commit is contained in:
nightwing 2012-05-03 23:57:01 +04:00
commit 6946024526

View file

@ -31,7 +31,6 @@ module.exports = {
editor.setStyle('insert-mode');
editor.unsetStyle('normal-mode');
editor.setOverwrite(false);
editor.keyBinding.$data.buffer = "";
editor.keyBinding.$data.state = "insertMode";
@ -44,6 +43,7 @@ module.exports = {
this.onInsertReplaySequence = null;
this.normalMode(editor);
} else {
editor._emit("vimMode", "insert");
// Record any movements, insertions in insert mode
if(!editor.commands.recording)
editor.commands.toggleRecording();
@ -69,6 +69,7 @@ module.exports = {
editor.keyBinding.$data.state = "start";
this.onVisualMode = false;
this.onVisualLineMode = false;
editor._emit("changeVimMode", "normal");
// Save recorded keystrokes
if (editor.commands.recording) {
editor.commands.toggleRecording();
@ -90,6 +91,7 @@ module.exports = {
editor.setStyle('insert-mode');
editor.unsetStyle('normal-mode');
editor._emit("changeVimMode", "visual");
if (lineMode) {
this.onVisualLineMode = true;
} else {