Skip to content

Commit

Permalink
[vim bindings] Fix/keymap/vim ctrl w idle
Browse files Browse the repository at this point in the history
  • Loading branch information
fraxx001 authored and marijnh committed Dec 15, 2018
1 parent eb174cf commit 9c1df7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions keymap/vim.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
{ keys: '~', type: 'operatorMotion', operator: 'changeCase', motion: 'moveByCharacters', motionArgs: { forward: true }, operatorArgs: { shouldMoveCursor: true }, context: 'normal'},
{ keys: '~', type: 'operator', operator: 'changeCase', context: 'visual'},
{ keys: '<C-w>', type: 'operatorMotion', operator: 'delete', motion: 'moveByWords', motionArgs: { forward: false, wordEnd: false }, context: 'insert' },
//ignore C-w in normal mode
{ keys: '<C-w>', type: 'idle', context: 'normal' },
// Actions
{ keys: '<C-i>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: true }},
{ keys: '<C-o>', type: 'action', action: 'jumpListWalk', actionArgs: { forward: false }},
Expand Down
10 changes: 10 additions & 0 deletions test/vim_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,16 @@ testVim('insert_ctrl_w', function(cm, vim, helpers) {
eqCursorPos(curEnd, cm.getCursor());
eq('vim-insert', cm.getOption('keyMap'));
}, { value: 'word1/word2' });
testVim('normal_ctrl_w', function(cm, vim, helpers) {
var curStart = makeCursor(0, 3);
cm.setCursor(curStart);
helpers.doKeys('<C-w>');
eq('word', cm.getValue());
var curEnd = makeCursor(0, 3);
helpers.assertCursorAt(0,3);
eqCursorPos(curEnd, cm.getCursor());
eq('vim', cm.getOption('keyMap'));
}, {value: 'word'});
testVim('a', function(cm, vim, helpers) {
cm.setCursor(0, 1);
helpers.doKeys('a');
Expand Down

0 comments on commit 9c1df7b

Please sign in to comment.