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