(cm, start, end)
| 12229 | 'visualBlock': vim.visualBlock}; |
| 12230 | } |
| 12231 | function expandSelection(cm, start, end) { |
| 12232 | var sel = cm.state.vim.sel; |
| 12233 | var head = sel.head; |
| 12234 | var anchor = sel.anchor; |
| 12235 | var tmp; |
| 12236 | if (cursorIsBefore(end, start)) { |
| 12237 | tmp = end; |
| 12238 | end = start; |
| 12239 | start = tmp; |
| 12240 | } |
| 12241 | if (cursorIsBefore(head, anchor)) { |
| 12242 | head = cursorMin(start, head); |
| 12243 | anchor = cursorMax(anchor, end); |
| 12244 | } else { |
| 12245 | anchor = cursorMin(start, anchor); |
| 12246 | head = cursorMax(head, end); |
| 12247 | head = offsetCursor(head, 0, -1); |
| 12248 | if (head.ch == -1 && head.line != cm.firstLine()) { |
| 12249 | head = Pos(head.line - 1, lineLength(cm, head.line - 1)); |
| 12250 | } |
| 12251 | } |
| 12252 | return [anchor, head]; |
| 12253 | } |
| 12254 | /** |
| 12255 | * Updates the CodeMirror selection to match the provided vim selection. |
| 12256 | * If no arguments are given, it uses the current vim selection state. |
no test coverage detected