emit event when changing mode
This commit is contained in:
parent
83ff661f4d
commit
6946024526
1 changed files with 3 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue