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