(cm, head, output)
| 3157 | |
| 3158 | // Draws a cursor for the given range |
| 3159 | function drawSelectionCursor(cm, head, output) { |
| 3160 | var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); |
| 3161 | |
| 3162 | var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); |
| 3163 | cursor.style.left = pos.left + "px"; |
| 3164 | cursor.style.top = pos.top + "px"; |
| 3165 | cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; |
| 3166 | |
| 3167 | if (pos.other) { |
| 3168 | // Secondary cursor, shown when on a 'jump' in bi-directional text |
| 3169 | var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); |
| 3170 | otherCursor.style.display = ""; |
| 3171 | otherCursor.style.left = pos.other.left + "px"; |
| 3172 | otherCursor.style.top = pos.other.top + "px"; |
| 3173 | otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; |
| 3174 | } |
| 3175 | } |
| 3176 | |
| 3177 | function cmpCoords(a, b) { return a.top - b.top || a.left - b.left } |
| 3178 |
no test coverage detected