(cm, vim)
| 3158 | // Updates the previous selection with the current selection's values. This |
| 3159 | // should only be called in visual mode. |
| 3160 | function updateLastSelection(cm, vim) { |
| 3161 | var anchor = vim.sel.anchor; |
| 3162 | var head = vim.sel.head; |
| 3163 | // To accommodate the effect of lastPastedText in the last selection |
| 3164 | if (vim.lastPastedText) { |
| 3165 | head = cm.posFromIndex(cm.indexFromPos(anchor) + vim.lastPastedText.length); |
| 3166 | vim.lastPastedText = null; |
| 3167 | } |
| 3168 | vim.lastSelection = {'anchorMark': cm.setBookmark(anchor), |
| 3169 | 'headMark': cm.setBookmark(head), |
| 3170 | 'anchor': copyCursor(anchor), |
| 3171 | 'head': copyCursor(head), |
| 3172 | 'visualMode': vim.visualMode, |
| 3173 | 'visualLine': vim.visualLine, |
| 3174 | 'visualBlock': vim.visualBlock}; |
| 3175 | } |
| 3176 | function expandSelection(cm, start, end) { |
| 3177 | var sel = cm.state.vim.sel; |
| 3178 | var head = sel.head; |
no test coverage detected