(cm, start, end)
| 3174 | 'visualBlock': vim.visualBlock}; |
| 3175 | } |
| 3176 | function expandSelection(cm, start, end) { |
| 3177 | var sel = cm.state.vim.sel; |
| 3178 | var head = sel.head; |
| 3179 | var anchor = sel.anchor; |
| 3180 | var tmp; |
| 3181 | if (cursorIsBefore(end, start)) { |
| 3182 | tmp = end; |
| 3183 | end = start; |
| 3184 | start = tmp; |
| 3185 | } |
| 3186 | if (cursorIsBefore(head, anchor)) { |
| 3187 | head = cursorMin(start, head); |
| 3188 | anchor = cursorMax(anchor, end); |
| 3189 | } else { |
| 3190 | anchor = cursorMin(start, anchor); |
| 3191 | head = cursorMax(head, end); |
| 3192 | head = offsetCursor(head, 0, -1); |
| 3193 | if (head.ch == -1 && head.line != cm.firstLine()) { |
| 3194 | head = Pos(head.line - 1, lineLength(cm, head.line - 1)); |
| 3195 | } |
| 3196 | } |
| 3197 | return [anchor, head]; |
| 3198 | } |
| 3199 | /** |
| 3200 | * Updates the CodeMirror selection to match the provided vim selection. |
| 3201 | * If no arguments are given, it uses the current vim selection state. |
no test coverage detected