(cm, vim)
| 12213 | // Updates the previous selection with the current selection's values. This |
| 12214 | // should only be called in visual mode. |
| 12215 | function updateLastSelection(cm, vim) { |
| 12216 | var anchor = vim.sel.anchor; |
| 12217 | var head = vim.sel.head; |
| 12218 | // To accommodate the effect of lastPastedText in the last selection |
| 12219 | if (vim.lastPastedText) { |
| 12220 | head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length); |
| 12221 | vim.lastPastedText = null; |
| 12222 | } |
| 12223 | vim.lastSelection = {'anchorMark': cm.setBookmark(anchor), |
| 12224 | 'headMark': cm.setBookmark(head), |
| 12225 | 'anchor': copyCursor(anchor), |
| 12226 | 'head': copyCursor(head), |
| 12227 | 'visualMode': vim.visualMode, |
| 12228 | 'visualLine': vim.visualLine, |
| 12229 | 'visualBlock': vim.visualBlock}; |
| 12230 | } |
| 12231 | function expandSelection(cm, start, end) { |
| 12232 | var sel = cm.state.vim.sel; |
| 12233 | var head = sel.head; |
no test coverage detected