Skip to content

Commit 6c9ecdc

Browse files
committed
Prevent s command in change mode
1 parent 758dce5 commit 6c9ecdc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

keymap/vim.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
{ keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>' },
8686
{ keys: '<C-[>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
8787
{ keys: '<C-c>', type: 'keyToKey', toKeys: '<Esc>', context: 'insert' },
88-
{ keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal' },
88+
{ keys: 's', type: 'keyToKey', toKeys: 'cl', context: 'normal', excludeOperator: ['change'] },
8989
{ keys: 's', type: 'keyToKey', toKeys: 'c', context: 'visual'},
9090
{ keys: 'S', type: 'keyToKey', toKeys: 'cc', context: 'normal' },
9191
{ keys: 'S', type: 'keyToKey', toKeys: 'VdO', context: 'visual' },
@@ -2861,6 +2861,7 @@
28612861
if (context == 'insert' && command.context != 'insert' ||
28622862
command.context && command.context != context ||
28632863
inputState.operator && command.type == 'action' ||
2864+
(command.excludeOperator && command.excludeOperator.includes(inputState.operator)) ||
28642865
!(match = commandMatch(keys, command.keys))) { continue; }
28652866
if (match == 'partial') { partial.push(command); }
28662867
if (match == 'full') { full.push(command); }

0 commit comments

Comments
 (0)