MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / exitVisualMode

Function exitVisualMode

lib/web/CodeMirror/keymap/vim.js:3276–3287  ·  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

3274 * in the right place.
3275 */
3276 function exitVisualMode(cm, moveHead) {
3277 var vim = cm.state.vim;
3278 if (moveHead !== false) {
3279 cm.setCursor(clipCursorToContent(cm, vim.sel.head));
3280 }
3281 updateLastSelection(cm, vim);
3282 vim.visualMode = false;
3283 vim.visualLine = false;
3284 vim.visualBlock = false;
3285 if (!vim.insertMode) CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
3286 clearFakeCursor(vim);
3287 }
3288
3289 // Remove any trailing newlines from the selection. For
3290 // 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
clearFakeCursorFunction · 0.85
signalMethod · 0.80

Tested by

no test coverage detected