MCPcopy
hub / github.com/witheve/Eve / handleKeyNonInsertMode

Function handleKeyNonInsertMode

src/codemirror.js:10126–10146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10124 }
10125
10126 function handleKeyNonInsertMode() {
10127 if (handleMacroRecording() || handleEsc()) { return true; };
10128
10129 var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key;
10130 if (/^[1-9]\d*$/.test(keys)) { return true; }
10131
10132 var keysMatcher = /^(\d*)(.*)$/.exec(keys);
10133 if (!keysMatcher) { clearInputState(cm); return false; }
10134 var context = vim.visualMode ? 'visual' :
10135 'normal';
10136 var match = commandDispatcher.matchCommand(keysMatcher[2] || keysMatcher[1], defaultKeymap, vim.inputState, context);
10137 if (match.type == 'none') { clearInputState(cm); return false; }
10138 else if (match.type == 'partial') { return true; }
10139
10140 vim.inputState.keyBuffer = '';
10141 var keysMatcher = /^(\d*)(.*)$/.exec(keys);
10142 if (keysMatcher[1] && keysMatcher[1] != '0') {
10143 vim.inputState.pushRepeatDigit(keysMatcher[1]);
10144 }
10145 return match.command;
10146 }
10147
10148 var command;
10149 if (vim.insertMode) { command = handleKeyInsertMode(); }

Callers 1

VimFunction · 0.85

Calls 4

handleMacroRecordingFunction · 0.85
handleEscFunction · 0.85
clearInputStateFunction · 0.85
testMethod · 0.45

Tested by

no test coverage detected