Merge pull request #10 from hnsol/feature/#8_add_iunmap_command

add ex command called 'iunmap'
This commit is contained in:
esm7 2020-12-30 10:27:53 +02:00 committed by GitHub
commit 7a93cf5b2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,6 +54,13 @@ export default class VimrcPlugin extends Plugin {
}
});
CodeMirror.Vim.defineEx('iunmap', '', function (cm, params) => {
if (params.argString.trim()) {
CodeMirror.Vim.unmap(params.argString.trim(), 'insert');
// console.log("ex command, iunmap executed: " + params.argString.trim());
}
});
vimCommands.split("\n").forEach(
function(line, index, arr) {
if (line.trim().length > 0 && line.trim()[0] != '"') {
@ -61,6 +68,7 @@ export default class VimrcPlugin extends Plugin {
}
}
)
// Make sure that we load it just once per CodeMirror instance.
// This is supposed to work because the Vim state is kept at the keymap level, hopefully
// there will not be bugs caused by operations that are kept at the object level instead