(cm, range, output)
| 1254 | |
| 1255 | // Draws a cursor for the given range |
| 1256 | function drawSelectionCursor(cm, range, output) { |
| 1257 | var pos = cursorCoords(cm, range.head, "div"); |
| 1258 | |
| 1259 | var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); |
| 1260 | cursor.style.left = pos.left + "px"; |
| 1261 | cursor.style.top = pos.top + "px"; |
| 1262 | cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; |
| 1263 | |
| 1264 | if (pos.other) { |
| 1265 | // Secondary cursor, shown when on a 'jump' in bi-directional text |
| 1266 | var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); |
| 1267 | otherCursor.style.display = ""; |
| 1268 | otherCursor.style.left = pos.other.left + "px"; |
| 1269 | otherCursor.style.top = pos.other.top + "px"; |
| 1270 | otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; |
| 1271 | } |
| 1272 | } |
| 1273 | |
| 1274 | // Draws the given range as a highlighted selection |
| 1275 | function drawSelectionRange(cm, range, output) { |
no test coverage detected