From 6c9ecdc47c53ed0f79652113d48cb660bafd49a5 Mon Sep 17 00:00:00 2001 From: Yukai Huang Date: Fri, 10 Apr 2020 22:39:56 +0800 Subject: [PATCH] Prevent s command in change mode --- keymap/vim.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keymap/vim.js b/keymap/vim.js index 6baf39ceab..aedc07adcc 100644 --- a/keymap/vim.js +++ b/keymap/vim.js @@ -85,7 +85,7 @@ { keys: '', type: 'keyToKey', toKeys: '' }, { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, { keys: '', type: 'keyToKey', toKeys: '', context: 'insert' }, - { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' }, + { keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal', excludeOperator: ['change'] }, { keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual'}, { keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' }, { keys: 'S', type: 'keyToKey', toKeys: 'VdO', context: 'visual' }, @@ -2861,6 +2861,7 @@ if (context == 'insert' && command.context != 'insert' || command.context && command.context != context || inputState.operator && command.type == 'action' || + (command.excludeOperator && command.excludeOperator.includes(inputState.operator)) || !(match = commandMatch(keys, command.keys))) { continue; } if (match == 'partial') { partial.push(command); } if (match == 'full') { full.push(command); }