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

Function exitVisualMode

src/codemirror.js:12331–12344  ·  view source on GitHub ↗

* If moveHead is set to false, the CodeMirror selection will not be * touched. The caller assumes the responsibility of putting the cursor * in the right place.

(cm, moveHead)

Source from the content-addressed store, hash-verified

12329 * in the right place.
12330 */
12331 function exitVisualMode(cm, moveHead) {
12332 var vim = cm.state.vim;
12333 if (moveHead !== false) {
12334 cm.setCursor(clipCursorToContent(cm, vim.sel.head));
12335 }
12336 updateLastSelection(cm, vim);
12337 vim.visualMode = false;
12338 vim.visualLine = false;
12339 vim.visualBlock = false;
12340 CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
12341 if (vim.fakeCursor) {
12342 vim.fakeCursor.clear();
12343 }
12344 }
12345
12346 // Remove any trailing newlines from the selection. For
12347 // example, with the caret at the start of the last word on the line,

Callers 3

handleEscFunction · 0.85
VimFunction · 0.85
handleExternalSelectionFunction · 0.85

Calls 4

clipCursorToContentFunction · 0.85
updateLastSelectionFunction · 0.85
setCursorMethod · 0.80
clearMethod · 0.65

Tested by

no test coverage detected