* 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)
| 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, |
no test coverage detected