properly remove old keybindings when adding new one
This commit is contained in:
parent
4923280c89
commit
674cc0d3fa
2 changed files with 4 additions and 2 deletions
|
|
@ -62,8 +62,9 @@ var KeyBinding = function(editor) {
|
||||||
if (this.$handlers[this.$handlers.length - 1] == kb)
|
if (this.$handlers[this.$handlers.length - 1] == kb)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.$handlers = [];
|
while (this.$handlers[1])
|
||||||
this.setDefaultHandler(this.$defaultHandler);
|
this.removeKeyboardHandler(this.$handlers[1]);
|
||||||
|
|
||||||
this.addKeyboardHandler(kb, 1);
|
this.addKeyboardHandler(kb, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ module.exports = {
|
||||||
editor.unsetStyle('normal-mode');
|
editor.unsetStyle('normal-mode');
|
||||||
if (editor.commands.recording)
|
if (editor.commands.recording)
|
||||||
editor.commands.toggleRecording();
|
editor.commands.toggleRecording();
|
||||||
|
editor.setOverwrite(false);
|
||||||
},
|
},
|
||||||
insertMode: function(editor) {
|
insertMode: function(editor) {
|
||||||
this.currentMode = 'insert';
|
this.currentMode = 'insert';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue